From e075e096cf4970014d2c0829476fd7a45a3f32b1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 8 Jul 2019 14:09:38 +0300 Subject: don't send LocationLink unless the client opts-in closes #1474 --- crates/ra_lsp_server/src/conv.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'crates/ra_lsp_server/src/conv.rs') diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index d0bdc94aa..82c7e757f 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs @@ -421,7 +421,15 @@ impl TryConvWith for (FileId, RangeInfo>) { .into_iter() .map(|nav| (file_id, RangeInfo::new(range, nav))) .try_conv_with_to_vec(world)?; - Ok(links.into()) + if world.options.supports_location_link { + Ok(links.into()) + } else { + let locations: Vec = links + .into_iter() + .map(|link| Location { uri: link.target_uri, range: link.target_selection_range }) + .collect(); + Ok(locations.into()) + } } } -- cgit v1.2.3