aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2020-04-26 23:57:33 +0100
committerkjeremy <[email protected]>2020-05-01 18:44:32 +0100
commite75565c73f935b7b4ee4182e632dfab210b26cff (patch)
tree7ef6d513d04993897c3e29bec6a57c1d96f10ab6 /crates
parente3ee61f5e81573a2e9415879c8740ac5d59eff06 (diff)
Advertise support for all the builtin CodeActionKinds
Even thought we don't return all of these we eventually will so might as well advertise now.
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/caps.rs28
1 files changed, 20 insertions, 8 deletions
diff --git a/crates/rust-analyzer/src/caps.rs b/crates/rust-analyzer/src/caps.rs
index e22ab8402..38780726f 100644
--- a/crates/rust-analyzer/src/caps.rs
+++ b/crates/rust-analyzer/src/caps.rs
@@ -3,13 +3,13 @@
3use crate::semantic_tokens; 3use crate::semantic_tokens;
4 4
5use lsp_types::{ 5use lsp_types::{
6 CallHierarchyServerCapability, CodeActionProviderCapability, CodeLensOptions, 6 CallHierarchyServerCapability, CodeActionOptions, CodeActionProviderCapability,
7 CompletionOptions, DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, 7 CodeLensOptions, CompletionOptions, DocumentOnTypeFormattingOptions,
8 ImplementationProviderCapability, RenameOptions, RenameProviderCapability, SaveOptions, 8 FoldingRangeProviderCapability, ImplementationProviderCapability, RenameOptions,
9 SelectionRangeProviderCapability, SemanticTokensDocumentProvider, SemanticTokensLegend, 9 RenameProviderCapability, SaveOptions, SelectionRangeProviderCapability,
10 SemanticTokensOptions, ServerCapabilities, SignatureHelpOptions, TextDocumentSyncCapability, 10 SemanticTokensDocumentProvider, SemanticTokensLegend, SemanticTokensOptions,
11 TextDocumentSyncKind, TextDocumentSyncOptions, TypeDefinitionProviderCapability, 11 ServerCapabilities, SignatureHelpOptions, TextDocumentSyncCapability, TextDocumentSyncKind,
12 WorkDoneProgressOptions, 12 TextDocumentSyncOptions, TypeDefinitionProviderCapability, WorkDoneProgressOptions,
13}; 13};
14 14
15pub fn server_capabilities() -> ServerCapabilities { 15pub fn server_capabilities() -> ServerCapabilities {
@@ -40,7 +40,19 @@ pub fn server_capabilities() -> ServerCapabilities {
40 document_highlight_provider: Some(true), 40 document_highlight_provider: Some(true),
41 document_symbol_provider: Some(true), 41 document_symbol_provider: Some(true),
42 workspace_symbol_provider: Some(true), 42 workspace_symbol_provider: Some(true),
43 code_action_provider: Some(CodeActionProviderCapability::Simple(true)), 43 code_action_provider: Some(CodeActionProviderCapability::Options(CodeActionOptions {
44 code_action_kinds: Some(vec![
45 "".to_string(),
46 lsp_types::code_action_kind::QUICKFIX.to_string(),
47 lsp_types::code_action_kind::REFACTOR.to_string(),
48 lsp_types::code_action_kind::REFACTOR_EXTRACT.to_string(),
49 lsp_types::code_action_kind::REFACTOR_INLINE.to_string(),
50 lsp_types::code_action_kind::REFACTOR_REWRITE.to_string(),
51 lsp_types::code_action_kind::SOURCE.to_string(),
52 lsp_types::code_action_kind::SOURCE_ORGANIZE_IMPORTS.to_string(),
53 ]),
54 work_done_progress_options: Default::default(),
55 })),
44 code_lens_provider: Some(CodeLensOptions { resolve_provider: Some(true) }), 56 code_lens_provider: Some(CodeLensOptions { resolve_provider: Some(true) }),
45 document_formatting_provider: Some(true), 57 document_formatting_provider: Some(true),
46 document_range_formatting_provider: None, 58 document_range_formatting_provider: None,