aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/conv.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-07-08 12:09:38 +0100
committerAleksey Kladov <[email protected]>2019-07-08 12:09:38 +0100
commite075e096cf4970014d2c0829476fd7a45a3f32b1 (patch)
treeb074a36491d838bae9405ac42f3e64ef9b4dcd60 /crates/ra_lsp_server/src/conv.rs
parentb042faeb64d858c26b05dbf543925bf626454282 (diff)
don't send LocationLink unless the client opts-in
closes #1474
Diffstat (limited to 'crates/ra_lsp_server/src/conv.rs')
-rw-r--r--crates/ra_lsp_server/src/conv.rs10
1 files changed, 9 insertions, 1 deletions
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<Vec<NavigationTarget>>) {
421 .into_iter() 421 .into_iter()
422 .map(|nav| (file_id, RangeInfo::new(range, nav))) 422 .map(|nav| (file_id, RangeInfo::new(range, nav)))
423 .try_conv_with_to_vec(world)?; 423 .try_conv_with_to_vec(world)?;
424 Ok(links.into()) 424 if world.options.supports_location_link {
425 Ok(links.into())
426 } else {
427 let locations: Vec<Location> = links
428 .into_iter()
429 .map(|link| Location { uri: link.target_uri, range: link.target_selection_range })
430 .collect();
431 Ok(locations.into())
432 }
425 } 433 }
426} 434}
427 435