diff options
author | Aleksey Kladov <[email protected]> | 2019-02-08 10:50:18 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-02-08 11:34:30 +0000 |
commit | bddd1242986f3155bdb1ca65495bc0623e3d211d (patch) | |
tree | 699b44c6bb2f4978430b3d84994f4f73897241ac /crates/ra_ide_api/src/imp.rs | |
parent | 842e8001b287b0e3d77215235ae96a3bd8944207 (diff) |
move crate for
Diffstat (limited to 'crates/ra_ide_api/src/imp.rs')
-rw-r--r-- | crates/ra_ide_api/src/imp.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/crates/ra_ide_api/src/imp.rs b/crates/ra_ide_api/src/imp.rs index 7d672656f..dea71740c 100644 --- a/crates/ra_ide_api/src/imp.rs +++ b/crates/ra_ide_api/src/imp.rs | |||
@@ -10,25 +10,12 @@ use ra_syntax::{ | |||
10 | use ra_db::SourceDatabase; | 10 | use ra_db::SourceDatabase; |
11 | 11 | ||
12 | use crate::{ | 12 | use crate::{ |
13 | CrateId, db, Diagnostic, FileId, FilePosition, FileSystemEdit, | 13 | db, Diagnostic, FileId, FilePosition, FileSystemEdit, |
14 | Query, SourceChange, SourceFileEdit, | 14 | Query, SourceChange, SourceFileEdit, |
15 | symbol_index::FileSymbol, | 15 | symbol_index::FileSymbol, |
16 | }; | 16 | }; |
17 | 17 | ||
18 | impl db::RootDatabase { | 18 | impl db::RootDatabase { |
19 | /// Returns `Vec` for the same reason as `parent_module` | ||
20 | pub(crate) fn crate_for(&self, file_id: FileId) -> Vec<CrateId> { | ||
21 | let module = match source_binder::module_from_file_id(self, file_id) { | ||
22 | Some(it) => it, | ||
23 | None => return Vec::new(), | ||
24 | }; | ||
25 | let krate = match module.krate(self) { | ||
26 | Some(it) => it, | ||
27 | None => return Vec::new(), | ||
28 | }; | ||
29 | vec![krate.crate_id()] | ||
30 | } | ||
31 | |||
32 | pub(crate) fn find_all_refs(&self, position: FilePosition) -> Vec<(FileId, TextRange)> { | 19 | pub(crate) fn find_all_refs(&self, position: FilePosition) -> Vec<(FileId, TextRange)> { |
33 | let file = self.parse(position.file_id); | 20 | let file = self.parse(position.file_id); |
34 | // Find the binding associated with the offset | 21 | // Find the binding associated with the offset |