mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
Take kind instead of edit in CodeAction ctor
Changes the `CodeAction` constructor to take a kind instead of an edit. This makes the API more consistent IMO, as now both `edit` and `command` are set the same way
This commit is contained in:
@@ -417,10 +417,10 @@ export class ExtHostApiCommands {
|
||||
} else {
|
||||
const ret = new types.CodeAction(
|
||||
codeAction.title,
|
||||
typeConverters.WorkspaceEdit.to(codeAction.edit)
|
||||
codeAction.kind ? new types.CodeActionKind(codeAction.kind) : undefined
|
||||
);
|
||||
if (codeAction.kind) {
|
||||
ret.scope = new types.CodeActionKind(codeAction.kind);
|
||||
if (codeAction.edit) {
|
||||
ret.edit = typeConverters.WorkspaceEdit.to(codeAction.edit);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -819,11 +819,11 @@ export class CodeAction {
|
||||
|
||||
dianostics?: Diagnostic[];
|
||||
|
||||
scope?: CodeActionKind;
|
||||
kind?: CodeActionKind;
|
||||
|
||||
constructor(title: string, edit?: WorkspaceEdit) {
|
||||
constructor(title: string, kind?: CodeActionKind) {
|
||||
this.title = title;
|
||||
this.edit = edit;
|
||||
this.kind = kind;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user