diff options
Diffstat (limited to 'crates/ide/src/display/navigation_target.rs')
-rw-r--r-- | crates/ide/src/display/navigation_target.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs index 23d885218..198243466 100644 --- a/crates/ide/src/display/navigation_target.rs +++ b/crates/ide/src/display/navigation_target.rs | |||
@@ -85,12 +85,16 @@ impl NavigationTarget { | |||
85 | let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); | 85 | let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); |
86 | if let Some(src) = module.declaration_source(db) { | 86 | if let Some(src) = module.declaration_source(db) { |
87 | let node = src.as_ref().map(|it| it.syntax()); | 87 | let node = src.as_ref().map(|it| it.syntax()); |
88 | let frange = node.original_file_range(db); | 88 | let full_range = node.original_file_range(db); |
89 | let focus_range = src | ||
90 | .value | ||
91 | .name() | ||
92 | .map(|name| src.with_value(name.syntax()).original_file_range(db).range); | ||
89 | let mut res = NavigationTarget::from_syntax( | 93 | let mut res = NavigationTarget::from_syntax( |
90 | frange.file_id, | 94 | full_range.file_id, |
91 | name, | 95 | name, |
92 | None, | 96 | focus_range, |
93 | frange.range, | 97 | full_range.range, |
94 | SymbolKind::Module, | 98 | SymbolKind::Module, |
95 | ); | 99 | ); |
96 | res.docs = module.attrs(db).docs(); | 100 | res.docs = module.attrs(db).docs(); |