diff options
author | Aleksey Kladov <[email protected]> | 2018-09-02 14:36:03 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-09-02 14:36:03 +0100 |
commit | e98d8cd255ab5c2fee873a58af6c2c3ad561dab4 (patch) | |
tree | 04869b8fe93e724d8aa266177e48644051331ab9 /crates/libanalysis/src | |
parent | 1329dd4e287c137ec0a90abeec0272275b2b2c8d (diff) |
nail down runnables
Diffstat (limited to 'crates/libanalysis/src')
-rw-r--r-- | crates/libanalysis/src/imp.rs | 6 | ||||
-rw-r--r-- | crates/libanalysis/src/lib.rs | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/crates/libanalysis/src/imp.rs b/crates/libanalysis/src/imp.rs index f1d72da15..b80ce1ab5 100644 --- a/crates/libanalysis/src/imp.rs +++ b/crates/libanalysis/src/imp.rs | |||
@@ -151,7 +151,7 @@ impl AnalysisImpl { | |||
151 | .collect() | 151 | .collect() |
152 | } | 152 | } |
153 | 153 | ||
154 | pub fn crate_root(&self, id: FileId) -> Vec<CrateId> { | 154 | pub fn crate_for(&self, id: FileId) -> Vec<CrateId> { |
155 | let module_map = &self.data.module_map; | 155 | let module_map = &self.data.module_map; |
156 | let crate_graph = &self.data.crate_graph; | 156 | let crate_graph = &self.data.crate_graph; |
157 | let mut res = Vec::new(); | 157 | let mut res = Vec::new(); |
@@ -177,7 +177,9 @@ impl AnalysisImpl { | |||
177 | } | 177 | } |
178 | res | 178 | res |
179 | } | 179 | } |
180 | 180 | pub fn crate_root(&self, crate_id: CrateId) -> FileId { | |
181 | self.data.crate_graph.crate_roots[&crate_id] | ||
182 | } | ||
181 | pub fn approximately_resolve_symbol( | 183 | pub fn approximately_resolve_symbol( |
182 | &self, | 184 | &self, |
183 | id: FileId, | 185 | id: FileId, |
diff --git a/crates/libanalysis/src/lib.rs b/crates/libanalysis/src/lib.rs index 041abbb89..ba290f1e0 100644 --- a/crates/libanalysis/src/lib.rs +++ b/crates/libanalysis/src/lib.rs | |||
@@ -182,8 +182,11 @@ impl Analysis { | |||
182 | pub fn parent_module(&self, file_id: FileId) -> Vec<(FileId, FileSymbol)> { | 182 | pub fn parent_module(&self, file_id: FileId) -> Vec<(FileId, FileSymbol)> { |
183 | self.imp.parent_module(file_id) | 183 | self.imp.parent_module(file_id) |
184 | } | 184 | } |
185 | pub fn crate_root(&self, file_id: FileId) -> Vec<CrateId> { | 185 | pub fn crate_for(&self, file_id: FileId) -> Vec<CrateId> { |
186 | self.imp.crate_root(file_id) | 186 | self.imp.crate_for(file_id) |
187 | } | ||
188 | pub fn crate_root(&self, crate_id: CrateId) -> FileId { | ||
189 | self.imp.crate_root(crate_id) | ||
187 | } | 190 | } |
188 | pub fn runnables(&self, file_id: FileId) -> Vec<Runnable> { | 191 | pub fn runnables(&self, file_id: FileId) -> Vec<Runnable> { |
189 | let file = self.file_syntax(file_id); | 192 | let file = self.file_syntax(file_id); |