diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/gen_lsp_server/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/caps.rs | 6 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 6 |
4 files changed, 10 insertions, 6 deletions
diff --git a/crates/gen_lsp_server/Cargo.toml b/crates/gen_lsp_server/Cargo.toml index 4eb508fc0..6580ba6e4 100644 --- a/crates/gen_lsp_server/Cargo.toml +++ b/crates/gen_lsp_server/Cargo.toml | |||
@@ -4,7 +4,7 @@ version = "0.1.0" | |||
4 | authors = ["Aleksey Kladov <[email protected]>"] | 4 | authors = ["Aleksey Kladov <[email protected]>"] |
5 | 5 | ||
6 | [dependencies] | 6 | [dependencies] |
7 | languageserver-types = "0.50.0" | 7 | languageserver-types = "0.51.0" |
8 | log = "0.4.3" | 8 | log = "0.4.3" |
9 | 9 | ||
10 | failure = "0.1.2" | 10 | failure = "0.1.2" |
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml index b851f70e1..32463e499 100644 --- a/crates/ra_lsp_server/Cargo.toml +++ b/crates/ra_lsp_server/Cargo.toml | |||
@@ -15,7 +15,7 @@ crossbeam-channel = "0.2.4" | |||
15 | flexi_logger = "0.9.1" | 15 | flexi_logger = "0.9.1" |
16 | log = "0.4.3" | 16 | log = "0.4.3" |
17 | url_serde = "0.2.0" | 17 | url_serde = "0.2.0" |
18 | languageserver-types = "0.50.0" | 18 | languageserver-types = "0.51.0" |
19 | walkdir = "2.2.0" | 19 | walkdir = "2.2.0" |
20 | im = "12.0.0" | 20 | im = "12.0.0" |
21 | cargo_metadata = "0.6.0" | 21 | cargo_metadata = "0.6.0" |
diff --git a/crates/ra_lsp_server/src/caps.rs b/crates/ra_lsp_server/src/caps.rs index 7456aea8a..3c628f29c 100644 --- a/crates/ra_lsp_server/src/caps.rs +++ b/crates/ra_lsp_server/src/caps.rs | |||
@@ -1,5 +1,7 @@ | |||
1 | use languageserver_types::{ | 1 | use languageserver_types::{ |
2 | ServerCapabilities, | 2 | ServerCapabilities, |
3 | CodeActionProviderCapability, | ||
4 | FoldingRangeProviderCapability, | ||
3 | TextDocumentSyncCapability, | 5 | TextDocumentSyncCapability, |
4 | TextDocumentSyncOptions, | 6 | TextDocumentSyncOptions, |
5 | TextDocumentSyncKind, | 7 | TextDocumentSyncKind, |
@@ -32,7 +34,7 @@ pub fn server_capabilities() -> ServerCapabilities { | |||
32 | document_highlight_provider: None, | 34 | document_highlight_provider: None, |
33 | document_symbol_provider: Some(true), | 35 | document_symbol_provider: Some(true), |
34 | workspace_symbol_provider: Some(true), | 36 | workspace_symbol_provider: Some(true), |
35 | code_action_provider: Some(true), | 37 | code_action_provider: Some(CodeActionProviderCapability::Simple(true)), |
36 | code_lens_provider: None, | 38 | code_lens_provider: None, |
37 | document_formatting_provider: None, | 39 | document_formatting_provider: None, |
38 | document_range_formatting_provider: None, | 40 | document_range_formatting_provider: None, |
@@ -40,10 +42,12 @@ pub fn server_capabilities() -> ServerCapabilities { | |||
40 | first_trigger_character: "=".to_string(), | 42 | first_trigger_character: "=".to_string(), |
41 | more_trigger_character: None, | 43 | more_trigger_character: None, |
42 | }), | 44 | }), |
45 | folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)), | ||
43 | rename_provider: None, | 46 | rename_provider: None, |
44 | color_provider: None, | 47 | color_provider: None, |
45 | execute_command_provider: Some(ExecuteCommandOptions { | 48 | execute_command_provider: Some(ExecuteCommandOptions { |
46 | commands: vec!["apply_code_action".to_string()], | 49 | commands: vec!["apply_code_action".to_string()], |
47 | }), | 50 | }), |
51 | workspace: None, | ||
48 | } | 52 | } |
49 | } | 53 | } |
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index b2ebc9cdc..2d9391859 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -2,7 +2,7 @@ use std::collections::HashMap; | |||
2 | 2 | ||
3 | use languageserver_types::{ | 3 | use languageserver_types::{ |
4 | Diagnostic, DiagnosticSeverity, DocumentSymbol, | 4 | Diagnostic, DiagnosticSeverity, DocumentSymbol, |
5 | Command, TextDocumentIdentifier, | 5 | CodeActionResponse, Command, TextDocumentIdentifier, |
6 | SymbolInformation, Position, Location, TextEdit, | 6 | SymbolInformation, Position, Location, TextEdit, |
7 | CompletionItem, InsertTextFormat, CompletionItemKind, | 7 | CompletionItem, InsertTextFormat, CompletionItemKind, |
8 | }; | 8 | }; |
@@ -369,7 +369,7 @@ pub fn handle_code_action( | |||
369 | world: ServerWorld, | 369 | world: ServerWorld, |
370 | params: req::CodeActionParams, | 370 | params: req::CodeActionParams, |
371 | _token: JobToken, | 371 | _token: JobToken, |
372 | ) -> Result<Option<Vec<Command>>> { | 372 | ) -> Result<Option<CodeActionResponse>> { |
373 | let file_id = params.text_document.try_conv_with(&world)?; | 373 | let file_id = params.text_document.try_conv_with(&world)?; |
374 | let line_index = world.analysis().file_line_index(file_id); | 374 | let line_index = world.analysis().file_line_index(file_id); |
375 | let range = params.range.conv_with(&line_index); | 375 | let range = params.range.conv_with(&line_index); |
@@ -392,7 +392,7 @@ pub fn handle_code_action( | |||
392 | res.push(cmd); | 392 | res.push(cmd); |
393 | } | 393 | } |
394 | 394 | ||
395 | Ok(Some(res)) | 395 | Ok(Some(CodeActionResponse::Commands(res))) |
396 | } | 396 | } |
397 | 397 | ||
398 | pub fn publish_diagnostics( | 398 | pub fn publish_diagnostics( |