From dda916bc4d51383fcf84f736bd12c7a77c445fb0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 11 Jan 2019 18:17:20 +0300 Subject: fix tests --- crates/ra_lsp_server/src/conv.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_lsp_server/src') 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 { type Output = Location; fn try_conv_with(self, world: &ServerWorld) -> Result { let line_index = world.analysis().file_line_index(self.file_id()); - to_location(self.file_id(), self.range(), &world, &line_index) + let range = self.focus_range().unwrap_or(self.full_range()); + to_location(self.file_id(), range, &world, &line_index) } } @@ -361,7 +362,7 @@ pub fn to_location_link( let res = LocationLink { origin_selection_range: Some(target.range.conv_with(line_index)), target_uri: url.to_string(), - target_range: target.info.range().conv_with(&tgt_line_index), + target_range: target.info.full_range().conv_with(&tgt_line_index), target_selection_range: target .info .focus_range() -- cgit v1.2.3