KISS SourceChange

The idea behind requiring the label is a noble one, but we are not
really using it consistently anyway, and it should be easy to retrofit
later, should we need it.
This commit is contained in:
Aleksey Kladov
2020-05-22 18:03:08 +02:00
parent 2075e77ee5
commit 2c04aad2d2
8 changed files with 112 additions and 153 deletions

View File

@@ -731,9 +731,9 @@ pub fn handle_code_action(
.filter(|(diag_range, _fix)| diag_range.intersect(range).is_some())
.map(|(_range, fix)| fix);
for source_edit in fixes_from_diagnostics {
let title = source_edit.label.clone();
let edit = to_proto::snippet_workspace_edit(&world, source_edit)?;
for fix in fixes_from_diagnostics {
let title = fix.label;
let edit = to_proto::snippet_workspace_edit(&world, fix.source_change)?;
let action =
lsp_ext::CodeAction { title, group: None, kind: None, edit: Some(edit), command: None };
res.push(action);