aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-11 16:37:32 +0000
committerAleksey Kladov <[email protected]>2019-12-11 16:37:32 +0000
commit58768b2a6343451bae8c4efb93ce7b1d598c914d (patch)
treeb5a6ae0efb25d4f9a4cb69e626d0600838ccd842 /crates
parent712700d8e027b108f9c4f8fa9acc2f25e453b6d1 (diff)
Revert "Support LSP 3.15"
This reverts commit fcccf8ec59420d20edc53f7d787f2412e297f5fe. This causes rust-analyzer die immediatelly after startup
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_lsp_server/Cargo.toml2
-rw-r--r--crates/ra_lsp_server/src/caps.rs7
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs3
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs5
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/main.rs21
5 files changed, 5 insertions, 33 deletions
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml
index c50cb8031..41672eaff 100644
--- a/crates/ra_lsp_server/Cargo.toml
+++ b/crates/ra_lsp_server/Cargo.toml
@@ -14,7 +14,7 @@ serde_json = "1.0.34"
14serde = { version = "1.0.83", features = ["derive"] } 14serde = { version = "1.0.83", features = ["derive"] }
15crossbeam-channel = "0.4" 15crossbeam-channel = "0.4"
16log = "0.4.3" 16log = "0.4.3"
17lsp-types = { version = "0.63.0", features = ["proposed"] } 17lsp-types = { version = "0.61.0", features = ["proposed"] }
18rustc-hash = "1.0" 18rustc-hash = "1.0"
19parking_lot = "0.10.0" 19parking_lot = "0.10.0"
20jod-thread = "0.1.0" 20jod-thread = "0.1.0"
diff --git a/crates/ra_lsp_server/src/caps.rs b/crates/ra_lsp_server/src/caps.rs
index 4cb259360..eea0965ed 100644
--- a/crates/ra_lsp_server/src/caps.rs
+++ b/crates/ra_lsp_server/src/caps.rs
@@ -5,7 +5,7 @@ use lsp_types::{
5 DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, GenericCapability, 5 DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, GenericCapability,
6 ImplementationProviderCapability, RenameOptions, RenameProviderCapability, ServerCapabilities, 6 ImplementationProviderCapability, RenameOptions, RenameProviderCapability, ServerCapabilities,
7 SignatureHelpOptions, TextDocumentSyncCapability, TextDocumentSyncKind, 7 SignatureHelpOptions, TextDocumentSyncCapability, TextDocumentSyncKind,
8 TextDocumentSyncOptions, TypeDefinitionProviderCapability, WorkDoneProgressOptions, 8 TextDocumentSyncOptions, TypeDefinitionProviderCapability,
9}; 9};
10 10
11pub fn server_capabilities() -> ServerCapabilities { 11pub fn server_capabilities() -> ServerCapabilities {
@@ -21,14 +21,10 @@ pub fn server_capabilities() -> ServerCapabilities {
21 completion_provider: Some(CompletionOptions { 21 completion_provider: Some(CompletionOptions {
22 resolve_provider: None, 22 resolve_provider: None,
23 trigger_characters: Some(vec![":".to_string(), ".".to_string()]), 23 trigger_characters: Some(vec![":".to_string(), ".".to_string()]),
24 work_done_progress_options: WorkDoneProgressOptions { work_done_progress: None },
25 }), 24 }),
26 signature_help_provider: Some(SignatureHelpOptions { 25 signature_help_provider: Some(SignatureHelpOptions {
27 trigger_characters: Some(vec!["(".to_string(), ",".to_string(), ")".to_string()]), 26 trigger_characters: Some(vec!["(".to_string(), ",".to_string(), ")".to_string()]),
28 retrigger_characters: None,
29 work_done_progress_options: WorkDoneProgressOptions { work_done_progress: None },
30 }), 27 }),
31 declaration_provider: None,
32 definition_provider: Some(true), 28 definition_provider: Some(true),
33 type_definition_provider: Some(TypeDefinitionProviderCapability::Simple(true)), 29 type_definition_provider: Some(TypeDefinitionProviderCapability::Simple(true)),
34 implementation_provider: Some(ImplementationProviderCapability::Simple(true)), 30 implementation_provider: Some(ImplementationProviderCapability::Simple(true)),
@@ -48,7 +44,6 @@ pub fn server_capabilities() -> ServerCapabilities {
48 folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)), 44 folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)),
49 rename_provider: Some(RenameProviderCapability::Options(RenameOptions { 45 rename_provider: Some(RenameProviderCapability::Options(RenameOptions {
50 prepare_provider: Some(true), 46 prepare_provider: Some(true),
51 work_done_progress_options: WorkDoneProgressOptions { work_done_progress: None },
52 })), 47 })),
53 document_link_provider: None, 48 document_link_provider: None,
54 color_provider: None, 49 color_provider: None,
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index 158cac0be..83845f1e0 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -520,8 +520,7 @@ fn on_notification(
520 if let Some(file_id) = state.vfs.write().remove_file_overlay(path.as_path()) { 520 if let Some(file_id) = state.vfs.write().remove_file_overlay(path.as_path()) {
521 subs.remove_sub(FileId(file_id.0)); 521 subs.remove_sub(FileId(file_id.0));
522 } 522 }
523 let params = 523 let params = req::PublishDiagnosticsParams { uri, diagnostics: Vec::new() };
524 req::PublishDiagnosticsParams { uri, diagnostics: Vec::new(), version: None };
525 let not = notification_new::<req::PublishDiagnostics>(params); 524 let not = notification_new::<req::PublishDiagnostics>(params);
526 msg_sender.send(not.into()).unwrap(); 525 msg_sender.send(not.into()).unwrap();
527 return Ok(()); 526 return Ok(());
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index 5b64b27cd..409583634 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -648,7 +648,6 @@ pub fn handle_code_action(
648 diagnostics: None, 648 diagnostics: None,
649 edit: None, 649 edit: None,
650 command: Some(command), 650 command: Some(command),
651 is_preferred: None,
652 }; 651 };
653 res.push(action.into()); 652 res.push(action.into());
654 } 653 }
@@ -671,7 +670,6 @@ pub fn handle_code_action(
671 diagnostics: None, 670 diagnostics: None,
672 edit: None, 671 edit: None,
673 command: Some(command), 672 command: Some(command),
674 is_preferred: None,
675 }; 673 };
676 res.push(action.into()); 674 res.push(action.into());
677 } 675 }
@@ -830,10 +828,9 @@ pub fn publish_diagnostics(
830 source: Some("rust-analyzer".to_string()), 828 source: Some("rust-analyzer".to_string()),
831 message: d.message, 829 message: d.message,
832 related_information: None, 830 related_information: None,
833 tags: None,
834 }) 831 })
835 .collect(); 832 .collect();
836 Ok(req::PublishDiagnosticsParams { uri, diagnostics, version: None }) 833 Ok(req::PublishDiagnosticsParams { uri, diagnostics })
837} 834}
838 835
839pub fn publish_decorations( 836pub fn publish_decorations(
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index dff63a12d..cfbf16ea5 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/main.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs
@@ -4,8 +4,7 @@ use std::{collections::HashMap, time::Instant};
4 4
5use lsp_types::{ 5use lsp_types::{
6 CodeActionContext, DidOpenTextDocumentParams, DocumentFormattingParams, FormattingOptions, 6 CodeActionContext, DidOpenTextDocumentParams, DocumentFormattingParams, FormattingOptions,
7 PartialResultParams, Position, Range, TextDocumentItem, TextDocumentPositionParams, 7 Position, Range, TextDocumentItem, TextDocumentPositionParams,
8 WorkDoneProgressParams,
9}; 8};
10use ra_lsp_server::req::{ 9use ra_lsp_server::req::{
11 CodeActionParams, CodeActionRequest, Completion, CompletionParams, DidOpenTextDocument, 10 CodeActionParams, CodeActionRequest, Completion, CompletionParams, DidOpenTextDocument,
@@ -49,8 +48,6 @@ use std::collections::Spam;
49 Position::new(0, 23), 48 Position::new(0, 23),
50 ), 49 ),
51 context: None, 50 context: None,
52 partial_result_params: PartialResultParams::default(),
53 work_done_progress_params: WorkDoneProgressParams::default(),
54 }); 51 });
55 assert!(format!("{}", res).contains("HashMap")); 52 assert!(format!("{}", res).contains("HashMap"));
56 eprintln!("completion took {:?}", completion_start.elapsed()); 53 eprintln!("completion took {:?}", completion_start.elapsed());
@@ -214,12 +211,8 @@ pub use std::collections::HashMap;
214 options: FormattingOptions { 211 options: FormattingOptions {
215 tab_size: 4, 212 tab_size: 4,
216 insert_spaces: false, 213 insert_spaces: false,
217 insert_final_newline: None,
218 trim_final_newlines: None,
219 trim_trailing_whitespace: None,
220 properties: HashMap::new(), 214 properties: HashMap::new(),
221 }, 215 },
222 work_done_progress_params: WorkDoneProgressParams::default(),
223 }, 216 },
224 json!([ 217 json!([
225 { 218 {
@@ -279,11 +272,7 @@ pub use std::collections::HashMap;
279 tab_size: 4, 272 tab_size: 4,
280 insert_spaces: false, 273 insert_spaces: false,
281 properties: HashMap::new(), 274 properties: HashMap::new(),
282 insert_final_newline: None,
283 trim_final_newlines: None,
284 trim_trailing_whitespace: None,
285 }, 275 },
286 work_done_progress_params: WorkDoneProgressParams::default(),
287 }, 276 },
288 json!([ 277 json!([
289 { 278 {
@@ -336,8 +325,6 @@ fn main() {}
336 text_document: server.doc_id("src/lib.rs"), 325 text_document: server.doc_id("src/lib.rs"),
337 range: Range::new(Position::new(0, 4), Position::new(0, 7)), 326 range: Range::new(Position::new(0, 4), Position::new(0, 7)),
338 context: empty_context(), 327 context: empty_context(),
339 partial_result_params: PartialResultParams::default(),
340 work_done_progress_params: WorkDoneProgressParams::default(),
341 }, 328 },
342 json!([ 329 json!([
343 { 330 {
@@ -369,8 +356,6 @@ fn main() {}
369 text_document: server.doc_id("src/lib.rs"), 356 text_document: server.doc_id("src/lib.rs"),
370 range: Range::new(Position::new(2, 4), Position::new(2, 7)), 357 range: Range::new(Position::new(2, 4), Position::new(2, 7)),
371 context: empty_context(), 358 context: empty_context(),
372 partial_result_params: PartialResultParams::default(),
373 work_done_progress_params: WorkDoneProgressParams::default(),
374 }, 359 },
375 json!([]), 360 json!([]),
376 ); 361 );
@@ -419,8 +404,6 @@ fn main() {{}}
419 text_document: server.doc_id("src/lib.rs"), 404 text_document: server.doc_id("src/lib.rs"),
420 range: Range::new(Position::new(0, 4), Position::new(0, 7)), 405 range: Range::new(Position::new(0, 4), Position::new(0, 7)),
421 context: empty_context(), 406 context: empty_context(),
422 partial_result_params: PartialResultParams::default(),
423 work_done_progress_params: WorkDoneProgressParams::default(),
424 }, 407 },
425 json!([ 408 json!([
426 { 409 {
@@ -452,8 +435,6 @@ fn main() {{}}
452 text_document: server.doc_id("src/lib.rs"), 435 text_document: server.doc_id("src/lib.rs"),
453 range: Range::new(Position::new(2, 4), Position::new(2, 7)), 436 range: Range::new(Position::new(2, 4), Position::new(2, 7)),
454 context: empty_context(), 437 context: empty_context(),
455 partial_result_params: PartialResultParams::default(),
456 work_done_progress_params: WorkDoneProgressParams::default(),
457 }, 438 },
458 json!([]), 439 json!([]),
459 ); 440 );