diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/caps.rs | 3 | ||||
-rw-r--r-- | crates/rust-analyzer/src/main_loop/handlers.rs | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/caps.rs b/crates/rust-analyzer/src/caps.rs index 38780726f..c0d320926 100644 --- a/crates/rust-analyzer/src/caps.rs +++ b/crates/rust-analyzer/src/caps.rs | |||
@@ -41,8 +41,9 @@ pub fn server_capabilities() -> ServerCapabilities { | |||
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::Options(CodeActionOptions { | 43 | code_action_provider: Some(CodeActionProviderCapability::Options(CodeActionOptions { |
44 | // Advertise support for all built-in CodeActionKinds | ||
44 | code_action_kinds: Some(vec![ | 45 | code_action_kinds: Some(vec![ |
45 | "".to_string(), | 46 | String::new(), |
46 | lsp_types::code_action_kind::QUICKFIX.to_string(), | 47 | lsp_types::code_action_kind::QUICKFIX.to_string(), |
47 | lsp_types::code_action_kind::REFACTOR.to_string(), | 48 | 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_EXTRACT.to_string(), |
diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index 647bdc426..0f623949e 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs | |||
@@ -703,7 +703,7 @@ fn create_single_code_action(assist: Assist, world: &WorldSnapshot) -> Result<Co | |||
703 | 703 | ||
704 | Ok(CodeAction { | 704 | Ok(CodeAction { |
705 | title, | 705 | title, |
706 | kind: Some("refactor".to_owned()), | 706 | kind: Some(String::new()), |
707 | diagnostics: None, | 707 | diagnostics: None, |
708 | edit: None, | 708 | edit: None, |
709 | command: Some(command), | 709 | command: Some(command), |
@@ -808,6 +808,7 @@ pub fn handle_code_action( | |||
808 | // If the client only supports commands then filter the list | 808 | // If the client only supports commands then filter the list |
809 | // and remove and actions that depend on edits. | 809 | // and remove and actions that depend on edits. |
810 | if !world.config.client_caps.code_action_literals { | 810 | if !world.config.client_caps.code_action_literals { |
811 | // FIXME: use drain_filter once it hits stable. | ||
811 | res = res | 812 | res = res |
812 | .into_iter() | 813 | .into_iter() |
813 | .filter_map(|it| match it { | 814 | .filter_map(|it| match it { |