diff options
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r-- | crates/ra_analysis/src/db.rs | 3 | ||||
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 9 |
2 files changed, 4 insertions, 8 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)); |