diff options
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r-- | crates/ra_lsp_server/src/caps.rs | 7 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop.rs | 3 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/crates/ra_lsp_server/src/caps.rs b/crates/ra_lsp_server/src/caps.rs index eea0965ed..4cb259360 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, | 8 | TextDocumentSyncOptions, TypeDefinitionProviderCapability, WorkDoneProgressOptions, |
9 | }; | 9 | }; |
10 | 10 | ||
11 | pub fn server_capabilities() -> ServerCapabilities { | 11 | pub fn server_capabilities() -> ServerCapabilities { |
@@ -21,10 +21,14 @@ 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 }, | ||
24 | }), | 25 | }), |
25 | signature_help_provider: Some(SignatureHelpOptions { | 26 | signature_help_provider: Some(SignatureHelpOptions { |
26 | trigger_characters: Some(vec!["(".to_string(), ",".to_string(), ")".to_string()]), | 27 | trigger_characters: Some(vec!["(".to_string(), ",".to_string(), ")".to_string()]), |
28 | retrigger_characters: None, | ||
29 | work_done_progress_options: WorkDoneProgressOptions { work_done_progress: None }, | ||
27 | }), | 30 | }), |
31 | declaration_provider: None, | ||
28 | definition_provider: Some(true), | 32 | definition_provider: Some(true), |
29 | type_definition_provider: Some(TypeDefinitionProviderCapability::Simple(true)), | 33 | type_definition_provider: Some(TypeDefinitionProviderCapability::Simple(true)), |
30 | implementation_provider: Some(ImplementationProviderCapability::Simple(true)), | 34 | implementation_provider: Some(ImplementationProviderCapability::Simple(true)), |
@@ -44,6 +48,7 @@ pub fn server_capabilities() -> ServerCapabilities { | |||
44 | folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)), | 48 | folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)), |
45 | rename_provider: Some(RenameProviderCapability::Options(RenameOptions { | 49 | rename_provider: Some(RenameProviderCapability::Options(RenameOptions { |
46 | prepare_provider: Some(true), | 50 | prepare_provider: Some(true), |
51 | work_done_progress_options: WorkDoneProgressOptions { work_done_progress: None }, | ||
47 | })), | 52 | })), |
48 | document_link_provider: None, | 53 | document_link_provider: None, |
49 | color_provider: None, | 54 | color_provider: None, |
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 83845f1e0..158cac0be 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs | |||
@@ -520,7 +520,8 @@ 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 = req::PublishDiagnosticsParams { uri, diagnostics: Vec::new() }; | 523 | let params = |
524 | req::PublishDiagnosticsParams { uri, diagnostics: Vec::new(), version: None }; | ||
524 | let not = notification_new::<req::PublishDiagnostics>(params); | 525 | let not = notification_new::<req::PublishDiagnostics>(params); |
525 | msg_sender.send(not.into()).unwrap(); | 526 | msg_sender.send(not.into()).unwrap(); |
526 | return Ok(()); | 527 | 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 409583634..5b64b27cd 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -648,6 +648,7 @@ 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, | ||
651 | }; | 652 | }; |
652 | res.push(action.into()); | 653 | res.push(action.into()); |
653 | } | 654 | } |
@@ -670,6 +671,7 @@ pub fn handle_code_action( | |||
670 | diagnostics: None, | 671 | diagnostics: None, |
671 | edit: None, | 672 | edit: None, |
672 | command: Some(command), | 673 | command: Some(command), |
674 | is_preferred: None, | ||
673 | }; | 675 | }; |
674 | res.push(action.into()); | 676 | res.push(action.into()); |
675 | } | 677 | } |
@@ -828,9 +830,10 @@ pub fn publish_diagnostics( | |||
828 | source: Some("rust-analyzer".to_string()), | 830 | source: Some("rust-analyzer".to_string()), |
829 | message: d.message, | 831 | message: d.message, |
830 | related_information: None, | 832 | related_information: None, |
833 | tags: None, | ||
831 | }) | 834 | }) |
832 | .collect(); | 835 | .collect(); |
833 | Ok(req::PublishDiagnosticsParams { uri, diagnostics }) | 836 | Ok(req::PublishDiagnosticsParams { uri, diagnostics, version: None }) |
834 | } | 837 | } |
835 | 838 | ||
836 | pub fn publish_decorations( | 839 | pub fn publish_decorations( |