aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2020-05-01 19:12:31 +0100
committerkjeremy <[email protected]>2020-05-01 19:12:31 +0100
commit99826dab153feffc8fe0d80600d9e812824d67b2 (patch)
tree07da881c1daeb65ea8e8683c367acc56e23cf322
parentee1628dba051e691a4ced756ab3cb360543609fa (diff)
Address comments
-rw-r--r--crates/rust-analyzer/src/caps.rs3
-rw-r--r--crates/rust-analyzer/src/main_loop/handlers.rs3
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 {