aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/tests
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/tests
parentb042faeb64d858c26b05dbf543925bf626454282 (diff)
don't send LocationLink unless the client opts-in
closes #1474
Diffstat (limited to 'crates/ra_lsp_server/tests')
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/support.rs24
1 files changed, 21 insertions, 3 deletions
diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/ra_lsp_server/tests/heavy_tests/support.rs
index a5e352da1..5dddbbe17 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/support.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/support.rs
@@ -13,7 +13,8 @@ use lsp_types::{
13 notification::DidOpenTextDocument, 13 notification::DidOpenTextDocument,
14 notification::{Notification, ShowMessage}, 14 notification::{Notification, ShowMessage},
15 request::{Request, Shutdown}, 15 request::{Request, Shutdown},
16 DidOpenTextDocumentParams, TextDocumentIdentifier, TextDocumentItem, Url, 16 ClientCapabilities, DidOpenTextDocumentParams, GotoCapability, TextDocumentClientCapabilities,
17 TextDocumentIdentifier, TextDocumentItem, Url,
17}; 18};
18use serde::Serialize; 19use serde::Serialize;
19use serde_json::{to_string_pretty, Value}; 20use serde_json::{to_string_pretty, Value};
@@ -92,8 +93,25 @@ impl Server {
92 "test server", 93 "test server",
93 128, 94 128,
94 move |msg_receiver, msg_sender| { 95 move |msg_receiver, msg_sender| {
95 main_loop(roots, InitializationOptions::default(), &msg_receiver, &msg_sender) 96 main_loop(
96 .unwrap() 97 roots,
98 ClientCapabilities {
99 workspace: None,
100 text_document: Some(TextDocumentClientCapabilities {
101 definition: Some(GotoCapability {
102 dynamic_registration: None,
103 link_support: Some(true),
104 }),
105 ..Default::default()
106 }),
107 window: None,
108 experimental: None,
109 },
110 InitializationOptions::default(),
111 &msg_receiver,
112 &msg_sender,
113 )
114 .unwrap()
97 }, 115 },
98 ); 116 );
99 let res = Server { req_id: Cell::new(1), dir, messages: Default::default(), worker }; 117 let res = Server { req_id: Cell::new(1), dir, messages: Default::default(), worker };