Mark fixes from diagnostics as quick fixes

This commit is contained in:
Jeremy Kolb 2020-05-17 21:03:40 -04:00 committed by kjeremy
parent e644f64f2a
commit 9e71fc0314
2 changed files with 9 additions and 2 deletions

View File

@ -730,8 +730,13 @@ pub fn handle_code_action(
for fix in fixes_from_diagnostics { for fix in fixes_from_diagnostics {
let title = fix.label; let title = fix.label;
let edit = to_proto::snippet_workspace_edit(&snap, fix.source_change)?; let edit = to_proto::snippet_workspace_edit(&snap, fix.source_change)?;
let action = let action = lsp_ext::CodeAction {
lsp_ext::CodeAction { title, group: None, kind: None, edit: Some(edit), command: None }; title,
group: None,
kind: Some(lsp_types::code_action_kind::QUICKFIX.into()),
edit: Some(edit),
command: None,
};
res.push(action); res.push(action);
} }

View File

@ -298,6 +298,7 @@ fn main() {}
} }
] ]
}, },
"kind": "quickfix",
"title": "Create module" "title": "Create module"
}]), }]),
); );
@ -368,6 +369,7 @@ fn main() {{}}
} }
] ]
}, },
"kind": "quickfix",
"title": "Create module" "title": "Create module"
}]), }]),
); );