diff options
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r-- | crates/ra_lsp_server/src/conv.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index aad698da1..76fa98cbe 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs | |||
@@ -345,7 +345,8 @@ impl TryConvWith for &NavigationTarget { | |||
345 | type Output = Location; | 345 | type Output = Location; |
346 | fn try_conv_with(self, world: &ServerWorld) -> Result<Location> { | 346 | fn try_conv_with(self, world: &ServerWorld) -> Result<Location> { |
347 | let line_index = world.analysis().file_line_index(self.file_id()); | 347 | let line_index = world.analysis().file_line_index(self.file_id()); |
348 | to_location(self.file_id(), self.range(), &world, &line_index) | 348 | let range = self.focus_range().unwrap_or(self.full_range()); |
349 | to_location(self.file_id(), range, &world, &line_index) | ||
349 | } | 350 | } |
350 | } | 351 | } |
351 | 352 | ||
@@ -361,7 +362,7 @@ pub fn to_location_link( | |||
361 | let res = LocationLink { | 362 | let res = LocationLink { |
362 | origin_selection_range: Some(target.range.conv_with(line_index)), | 363 | origin_selection_range: Some(target.range.conv_with(line_index)), |
363 | target_uri: url.to_string(), | 364 | target_uri: url.to_string(), |
364 | target_range: target.info.range().conv_with(&tgt_line_index), | 365 | target_range: target.info.full_range().conv_with(&tgt_line_index), |
365 | target_selection_range: target | 366 | target_selection_range: target |
366 | .info | 367 | .info |
367 | .focus_range() | 368 | .focus_range() |