diff options
author | Aleksey Kladov <[email protected]> | 2018-12-19 07:26:24 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-20 09:15:38 +0000 |
commit | b6ce7a6d344fa673addcd299cbb19b050625e04d (patch) | |
tree | 1e4a1531d3c9431a1f2ec43b41b19e5ad6b2ad4c /crates | |
parent | dea1a69e1cb0af7d6917d351a811ef205b7dfef9 (diff) |
make it compile
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_analysis/src/db.rs | 3 | ||||
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 9 | ||||
-rw-r--r-- | crates/ra_db/src/input.rs | 2 | ||||
-rw-r--r-- | crates/ra_db/src/lib.rs | 1 |
4 files changed, 6 insertions, 9 deletions
diff --git a/crates/ra_analysis/src/db.rs b/crates/ra_analysis/src/db.rs index b8d774eb5..9f39d3a59 100644 --- a/crates/ra_analysis/src/db.rs +++ b/crates/ra_analysis/src/db.rs | |||
@@ -61,7 +61,10 @@ salsa::database_storage! { | |||
61 | pub(crate) struct RootDatabaseStorage for RootDatabase { | 61 | pub(crate) struct RootDatabaseStorage for RootDatabase { |
62 | impl ra_db::FilesDatabase { | 62 | impl ra_db::FilesDatabase { |
63 | fn file_text() for ra_db::FileTextQuery; | 63 | fn file_text() for ra_db::FileTextQuery; |
64 | fn file_relative_path() for ra_db::FileRelativePathQuery; | ||
64 | fn file_source_root() for ra_db::FileSourceRootQuery; | 65 | fn file_source_root() for ra_db::FileSourceRootQuery; |
66 | fn source_root_files() for ra_db::SourceRootFilesQuery; | ||
67 | fn source_root_file_by_path() for ra_db::SourceRootFileByPathQuery; | ||
65 | fn source_root() for ra_db::SourceRootQuery; | 68 | fn source_root() for ra_db::SourceRootQuery; |
66 | fn libraries() for ra_db::LibrariesQuery; | 69 | fn libraries() for ra_db::LibrariesQuery; |
67 | fn crate_graph() for ra_db::CrateGraphQuery; | 70 | fn crate_graph() for ra_db::CrateGraphQuery; |
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 0de0e2645..e2c20b0e3 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -51,9 +51,6 @@ impl AnalysisHostImpl { | |||
51 | .set(file_id, Arc::new(text)) | 51 | .set(file_id, Arc::new(text)) |
52 | } | 52 | } |
53 | if !(change.files_added.is_empty() && change.files_removed.is_empty()) { | 53 | if !(change.files_added.is_empty() && change.files_removed.is_empty()) { |
54 | let file_resolver = change | ||
55 | .file_resolver | ||
56 | .expect("change resolver when changing set of files"); | ||
57 | let mut source_root = SourceRoot::clone(&self.db.source_root(WORKSPACE)); | 54 | let mut source_root = SourceRoot::clone(&self.db.source_root(WORKSPACE)); |
58 | for (file_id, text) in change.files_added { | 55 | for (file_id, text) in change.files_added { |
59 | self.db | 56 | self.db |
@@ -70,7 +67,6 @@ impl AnalysisHostImpl { | |||
70 | .set(file_id, Arc::new(String::new())); | 67 | .set(file_id, Arc::new(String::new())); |
71 | source_root.files.remove(&file_id); | 68 | source_root.files.remove(&file_id); |
72 | } | 69 | } |
73 | source_root.file_resolver = file_resolver; | ||
74 | self.db | 70 | self.db |
75 | .query_mut(ra_db::SourceRootQuery) | 71 | .query_mut(ra_db::SourceRootQuery) |
76 | .set(WORKSPACE, Arc::new(source_root)) | 72 | .set(WORKSPACE, Arc::new(source_root)) |
@@ -95,10 +91,7 @@ impl AnalysisHostImpl { | |||
95 | .query_mut(ra_db::FileTextQuery) | 91 | .query_mut(ra_db::FileTextQuery) |
96 | .set_constant(file_id, Arc::new(text)); | 92 | .set_constant(file_id, Arc::new(text)); |
97 | } | 93 | } |
98 | let source_root = SourceRoot { | 94 | let source_root = SourceRoot { files }; |
99 | files, | ||
100 | file_resolver: library.file_resolver, | ||
101 | }; | ||
102 | self.db | 95 | self.db |
103 | .query_mut(ra_db::SourceRootQuery) | 96 | .query_mut(ra_db::SourceRootQuery) |
104 | .set(source_root_id, Arc::new(source_root)); | 97 | .set(source_root_id, Arc::new(source_root)); |
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index 9edaf36cf..65b674da9 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs | |||
@@ -98,7 +98,7 @@ salsa::query_group! { | |||
98 | storage input; | 98 | storage input; |
99 | } | 99 | } |
100 | fn source_root_file_by_path(id: SourceRootId, path: RelativePathBuf) -> Option<FileId> { | 100 | fn source_root_file_by_path(id: SourceRootId, path: RelativePathBuf) -> Option<FileId> { |
101 | type SourceRootFilesByPathQuery; | 101 | type SourceRootFileByPathQuery; |
102 | storage input; | 102 | storage input; |
103 | } | 103 | } |
104 | fn source_root(id: SourceRootId) -> Arc<SourceRoot> { | 104 | fn source_root(id: SourceRootId) -> Arc<SourceRoot> { |
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 53805aada..783b7a799 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs | |||
@@ -28,6 +28,7 @@ pub use crate::{ | |||
28 | input::{ | 28 | input::{ |
29 | FilesDatabase, FileId, CrateId, SourceRoot, SourceRootId, CrateGraph, WORKSPACE, | 29 | FilesDatabase, FileId, CrateId, SourceRoot, SourceRootId, CrateGraph, WORKSPACE, |
30 | FileTextQuery, FileSourceRootQuery, SourceRootQuery, LibrariesQuery, CrateGraphQuery, | 30 | FileTextQuery, FileSourceRootQuery, SourceRootQuery, LibrariesQuery, CrateGraphQuery, |
31 | FileRelativePathQuery, SourceRootFilesQuery, SourceRootFileByPathQuery, | ||
31 | }, | 32 | }, |
32 | loc2id::{LocationIntener, NumericId}, | 33 | loc2id::{LocationIntener, NumericId}, |
33 | }; | 34 | }; |