mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Merge #4502
4502: Mark fixes from diagnostics as quick fixes r=kjeremy a=kjeremy Populates the diagnostic UI with fixes: Before:  After:  Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
This commit is contained in:
commit
a33cfcb55d
2 changed files with 9 additions and 2 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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"
|
||||||
}]),
|
}]),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue