diff options
author | Aleksey Kladov <[email protected]> | 2018-09-03 19:03:37 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-09-03 19:03:37 +0100 |
commit | 47cbaeba6f21e59ee8735bfe8bcbf06300767b57 (patch) | |
tree | 779f75f740a1717ab225a52f26f53562c28ace4d /crates/libanalysis | |
parent | b04c14d4ad51433b0055e2e5799f98da20d15d58 (diff) |
Index deps
Diffstat (limited to 'crates/libanalysis')
-rw-r--r-- | crates/libanalysis/src/imp.rs | 10 | ||||
-rw-r--r-- | crates/libanalysis/src/lib.rs | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/crates/libanalysis/src/imp.rs b/crates/libanalysis/src/imp.rs index c1e144025..3ea27947e 100644 --- a/crates/libanalysis/src/imp.rs +++ b/crates/libanalysis/src/imp.rs | |||
@@ -57,9 +57,9 @@ impl AnalysisHostImpl { | |||
57 | } | 57 | } |
58 | self.data_mut().crate_graph = graph; | 58 | self.data_mut().crate_graph = graph; |
59 | } | 59 | } |
60 | pub fn set_libraries(&mut self, libs: impl Iterator<Item=impl Iterator<Item=(FileId, String)>>) { | 60 | pub fn add_library(&mut self, files: impl Iterator<Item=(FileId, String)>) { |
61 | let libs = libs.map(ReadonlySourceRoot::new).collect::<Vec<_>>(); | 61 | let libs = ReadonlySourceRoot::new(files); |
62 | self.data_mut().libs = Arc::new(libs); | 62 | self.data_mut().libs.push(Arc::new(libs)); |
63 | } | 63 | } |
64 | fn data_mut(&mut self) -> &mut WorldData { | 64 | fn data_mut(&mut self) -> &mut WorldData { |
65 | Arc::make_mut(&mut self.data) | 65 | Arc::make_mut(&mut self.data) |
@@ -93,7 +93,7 @@ impl AnalysisImpl { | |||
93 | if self.data.root.contains(file_id) { | 93 | if self.data.root.contains(file_id) { |
94 | return &self.data.root; | 94 | return &self.data.root; |
95 | } | 95 | } |
96 | self.data.libs.iter().find(|it| it.contains(file_id)).unwrap() | 96 | &**self.data.libs.iter().find(|it| it.contains(file_id)).unwrap() |
97 | } | 97 | } |
98 | pub fn file_syntax(&self, file_id: FileId) -> &File { | 98 | pub fn file_syntax(&self, file_id: FileId) -> &File { |
99 | self.root(file_id).syntax(file_id) | 99 | self.root(file_id).syntax(file_id) |
@@ -308,7 +308,7 @@ impl AnalysisImpl { | |||
308 | struct WorldData { | 308 | struct WorldData { |
309 | crate_graph: CrateGraph, | 309 | crate_graph: CrateGraph, |
310 | root: WritableSourceRoot, | 310 | root: WritableSourceRoot, |
311 | libs: Arc<Vec<ReadonlySourceRoot>>, | 311 | libs: Vec<Arc<ReadonlySourceRoot>>, |
312 | } | 312 | } |
313 | 313 | ||
314 | impl SourceChange { | 314 | impl SourceChange { |
diff --git a/crates/libanalysis/src/lib.rs b/crates/libanalysis/src/lib.rs index 9ae87d46c..e9e0c51d5 100644 --- a/crates/libanalysis/src/lib.rs +++ b/crates/libanalysis/src/lib.rs | |||
@@ -68,8 +68,8 @@ impl AnalysisHost { | |||
68 | pub fn set_crate_graph(&mut self, graph: CrateGraph) { | 68 | pub fn set_crate_graph(&mut self, graph: CrateGraph) { |
69 | self.imp.set_crate_graph(graph) | 69 | self.imp.set_crate_graph(graph) |
70 | } | 70 | } |
71 | pub fn set_libraries(&mut self, libs: impl Iterator<Item=impl Iterator<Item=(FileId, String)>>) { | 71 | pub fn add_library(&mut self, files: impl Iterator<Item=(FileId, String)>) { |
72 | self.imp.set_libraries(libs) | 72 | self.imp.add_library(files) |
73 | } | 73 | } |
74 | } | 74 | } |
75 | 75 | ||