Skip to content

Commit 4a3a525

Browse files
committed
Use new format for all assists that don't change cursor positon
1 parent 28f6b5b commit 4a3a525

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/rust-analyzer/src/to_proto.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,14 +639,15 @@ fn main() <fold>{
639639
}
640640

641641
pub(crate) fn code_action(world: &WorldSnapshot, assist: Assist) -> Result<lsp_ext::CodeAction> {
642-
let res = if assist.source_change.is_snippet {
642+
let res = if assist.source_change.cursor_position.is_none() {
643643
lsp_ext::CodeAction {
644644
title: assist.label,
645645
kind: Some(String::new()),
646646
edit: Some(snippet_workspace_edit(world, assist.source_change)?),
647647
command: None,
648648
}
649649
} else {
650+
assert!(!assist.source_change.is_snippet);
650651
let source_change = source_change(&world, assist.source_change)?;
651652
let arg = serde_json::to_value(source_change)?;
652653
let title = assist.label;

0 commit comments

Comments
 (0)