diff options
author | Aleksey Kladov <[email protected]> | 2020-06-30 12:03:08 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-06-30 12:03:08 +0100 |
commit | 4484908a867fc742104d6ffe63b865a411203276 (patch) | |
tree | 048d7019112e588f4416ed88070f59ae46564d75 /crates/ra_ide/src/display | |
parent | d34e725f09994af145884464942dd205bfc7717e (diff) |
Rewrite goto definition tests
Diffstat (limited to 'crates/ra_ide/src/display')
-rw-r--r-- | crates/ra_ide/src/display/navigation_target.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index 0b52b01ab..02f55e5ba 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs | |||
@@ -64,6 +64,7 @@ impl NavigationTarget { | |||
64 | self.file_id | 64 | self.file_id |
65 | } | 65 | } |
66 | 66 | ||
67 | // TODO: inconsistent | ||
67 | pub fn file_range(&self) -> FileRange { | 68 | pub fn file_range(&self) -> FileRange { |
68 | FileRange { file_id: self.file_id, range: self.full_range } | 69 | FileRange { file_id: self.file_id, range: self.full_range } |
69 | } | 70 | } |
@@ -283,11 +284,13 @@ impl ToNav for hir::ImplDef { | |||
283 | } else { | 284 | } else { |
284 | original_range(db, src.as_ref().map(|it| it.syntax())) | 285 | original_range(db, src.as_ref().map(|it| it.syntax())) |
285 | }; | 286 | }; |
287 | let focus_range = | ||
288 | src.value.target_type().map(|ty| original_range(db, src.with_value(ty.syntax())).range); | ||
286 | 289 | ||
287 | NavigationTarget::from_syntax( | 290 | NavigationTarget::from_syntax( |
288 | frange.file_id, | 291 | frange.file_id, |
289 | "impl".into(), | 292 | "impl".into(), |
290 | None, | 293 | focus_range, |
291 | frange.range, | 294 | frange.range, |
292 | src.value.syntax().kind(), | 295 | src.value.syntax().kind(), |
293 | ) | 296 | ) |