diff options
Diffstat (limited to 'crates/ra_ide_api/src/imp.rs')
-rw-r--r-- | crates/ra_ide_api/src/imp.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/crates/ra_ide_api/src/imp.rs b/crates/ra_ide_api/src/imp.rs index 7c60ab7d6..12bfe1761 100644 --- a/crates/ra_ide_api/src/imp.rs +++ b/crates/ra_ide_api/src/imp.rs | |||
@@ -11,7 +11,6 @@ use ra_syntax::{ | |||
11 | TextRange, AstNode, SourceFile, | 11 | TextRange, AstNode, SourceFile, |
12 | ast::{self, NameOwner}, | 12 | ast::{self, NameOwner}, |
13 | algo::find_node_at_offset, | 13 | algo::find_node_at_offset, |
14 | SyntaxKind::*, | ||
15 | }; | 14 | }; |
16 | 15 | ||
17 | use crate::{ | 16 | use crate::{ |
@@ -109,18 +108,8 @@ impl db::RootDatabase { | |||
109 | None => return Ok(Vec::new()), | 108 | None => return Ok(Vec::new()), |
110 | Some(it) => it, | 109 | Some(it) => it, |
111 | }; | 110 | }; |
112 | let (file_id, ast_module) = match module.declaration_source(self)? { | 111 | let nav = NavigationTarget::from_module(self, module)?; |
113 | None => return Ok(Vec::new()), | 112 | Ok(vec![nav]) |
114 | Some(it) => it, | ||
115 | }; | ||
116 | let name = ast_module.name().unwrap(); | ||
117 | Ok(vec![NavigationTarget { | ||
118 | file_id, | ||
119 | name: name.text().clone(), | ||
120 | range: name.syntax().range(), | ||
121 | kind: MODULE, | ||
122 | ptr: None, | ||
123 | }]) | ||
124 | } | 113 | } |
125 | /// Returns `Vec` for the same reason as `parent_module` | 114 | /// Returns `Vec` for the same reason as `parent_module` |
126 | pub(crate) fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> { | 115 | pub(crate) fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> { |