Address comments

This commit is contained in:
kjeremy 2020-05-01 14:12:31 -04:00
parent ee1628dba0
commit 99826dab15
2 changed files with 4 additions and 2 deletions

View File

@ -41,8 +41,9 @@ pub fn server_capabilities() -> ServerCapabilities {
document_symbol_provider: Some(true),
workspace_symbol_provider: Some(true),
code_action_provider: Some(CodeActionProviderCapability::Options(CodeActionOptions {
// Advertise support for all built-in CodeActionKinds
code_action_kinds: Some(vec![
"".to_string(),
String::new(),
lsp_types::code_action_kind::QUICKFIX.to_string(),
lsp_types::code_action_kind::REFACTOR.to_string(),
lsp_types::code_action_kind::REFACTOR_EXTRACT.to_string(),

View File

@ -703,7 +703,7 @@ fn create_single_code_action(assist: Assist, world: &WorldSnapshot) -> Result<Co
Ok(CodeAction {
title,
kind: Some("refactor".to_owned()),
kind: Some(String::new()),
diagnostics: None,
edit: None,
command: Some(command),
@ -808,6 +808,7 @@ pub fn handle_code_action(
// If the client only supports commands then filter the list
// and remove and actions that depend on edits.
if !world.config.client_caps.code_action_literals {
// FIXME: use drain_filter once it hits stable.
res = res
.into_iter()
.filter_map(|it| match it {