Skip to content

Commit c0588be

Browse files
GearsDatapackslpil
authored andcommitted
Tweak code actions
1 parent 190239b commit c0588be

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler-core/src/language_server/code_action.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,9 @@ impl<'ast> ast::visit::Visit<'ast> for LetAssertToCase<'_> {
402402
let uri = &self.params.text_document.uri;
403403

404404
CodeActionBuilder::new("Convert to case")
405-
.kind(CodeActionKind::REFACTOR)
405+
.kind(CodeActionKind::REFACTOR_REWRITE)
406406
.changes(uri.clone(), vec![TextEdit { range, new_text }])
407-
.preferred(true)
407+
.preferred(false)
408408
.push_to(&mut self.actions);
409409
}
410410
}
@@ -763,9 +763,9 @@ impl<'a> FillInMissingLabelledArgs<'a> {
763763

764764
let mut action = Vec::with_capacity(1);
765765
CodeActionBuilder::new("Fill labels")
766-
.kind(CodeActionKind::REFACTOR)
766+
.kind(CodeActionKind::QUICKFIX)
767767
.changes(self.params.text_document.uri.clone(), self.edits.edits)
768-
.preferred(false)
768+
.preferred(true)
769769
.push_to(&mut action);
770770
return action;
771771
}
@@ -1228,7 +1228,7 @@ impl<'a> AddAnnotations<'a> {
12281228
CodeActionBuilder::new(title)
12291229
.kind(CodeActionKind::REFACTOR)
12301230
.changes(uri.clone(), self.edits.edits)
1231-
.preferred(true)
1231+
.preferred(false)
12321232
.push_to(actions);
12331233
}
12341234
}
@@ -2662,7 +2662,7 @@ impl<'a> ExtractVariable<'a> {
26622662

26632663
let mut action = Vec::with_capacity(1);
26642664
CodeActionBuilder::new("Extract variable")
2665-
.kind(CodeActionKind::REFACTOR_REWRITE)
2665+
.kind(CodeActionKind::REFACTOR_EXTRACT)
26662666
.changes(self.params.text_document.uri.clone(), self.edits.edits)
26672667
.preferred(false)
26682668
.push_to(&mut action);

0 commit comments

Comments
 (0)