Skip to content

Commit 99826da

Browse files
committed
Address comments
1 parent ee1628d commit 99826da

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

crates/rust-analyzer/src/caps.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ pub fn server_capabilities() -> ServerCapabilities {
4141
document_symbol_provider: Some(true),
4242
workspace_symbol_provider: Some(true),
4343
code_action_provider: Some(CodeActionProviderCapability::Options(CodeActionOptions {
44+
// Advertise support for all built-in CodeActionKinds
4445
code_action_kinds: Some(vec![
45-
"".to_string(),
46+
String::new(),
4647
lsp_types::code_action_kind::QUICKFIX.to_string(),
4748
lsp_types::code_action_kind::REFACTOR.to_string(),
4849
lsp_types::code_action_kind::REFACTOR_EXTRACT.to_string(),

crates/rust-analyzer/src/main_loop/handlers.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ fn create_single_code_action(assist: Assist, world: &WorldSnapshot) -> Result<Co
703703

704704
Ok(CodeAction {
705705
title,
706-
kind: Some("refactor".to_owned()),
706+
kind: Some(String::new()),
707707
diagnostics: None,
708708
edit: None,
709709
command: Some(command),
@@ -808,6 +808,7 @@ pub fn handle_code_action(
808808
// If the client only supports commands then filter the list
809809
// and remove and actions that depend on edits.
810810
if !world.config.client_caps.code_action_literals {
811+
// FIXME: use drain_filter once it hits stable.
811812
res = res
812813
.into_iter()
813814
.filter_map(|it| match it {

0 commit comments

Comments
 (0)