Skip to content

Commit 9e71fc0

Browse files
committed
Mark fixes from diagnostics as quick fixes
1 parent e644f64 commit 9e71fc0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

crates/rust-analyzer/src/main_loop/handlers.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,13 @@ pub fn handle_code_action(
730730
for fix in fixes_from_diagnostics {
731731
let title = fix.label;
732732
let edit = to_proto::snippet_workspace_edit(&snap, fix.source_change)?;
733-
let action =
734-
lsp_ext::CodeAction { title, group: None, kind: None, edit: Some(edit), command: None };
733+
let action = lsp_ext::CodeAction {
734+
title,
735+
group: None,
736+
kind: Some(lsp_types::code_action_kind::QUICKFIX.into()),
737+
edit: Some(edit),
738+
command: None,
739+
};
735740
res.push(action);
736741
}
737742

crates/rust-analyzer/tests/heavy_tests/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ fn main() {}
298298
}
299299
]
300300
},
301+
"kind": "quickfix",
301302
"title": "Create module"
302303
}]),
303304
);
@@ -368,6 +369,7 @@ fn main() {{}}
368369
}
369370
]
370371
},
372+
"kind": "quickfix",
371373
"title": "Create module"
372374
}]),
373375
);

0 commit comments

Comments
 (0)