mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
Fix inconsistent code action edit property names
**Bug** We were using `edits` in some places and `edit` in others. This broke some use patterns for code actions
This commit is contained in:
@@ -630,7 +630,7 @@ export interface WorkspaceEditDto {
|
||||
|
||||
export interface CodeActionDto {
|
||||
title: string;
|
||||
edits?: WorkspaceEditDto;
|
||||
edit?: WorkspaceEditDto;
|
||||
diagnostics?: IMarkerData[];
|
||||
command?: modes.Command;
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ export class ExtHostApiCommands {
|
||||
} else {
|
||||
const ret = new types.CodeAction(
|
||||
codeAction.title,
|
||||
typeConverters.WorkspaceEdit.to(codeAction.edits)
|
||||
typeConverters.WorkspaceEdit.to(codeAction.edit)
|
||||
);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ class CodeActionAdapter {
|
||||
title: candidate.title,
|
||||
command: candidate.command && this._commands.toInternal(candidate.command),
|
||||
diagnostics: candidate.diagnostics && candidate.diagnostics.map(DiagnosticCollection.toMarkerData),
|
||||
edits: candidate.edit && TypeConverters.WorkspaceEdit.from(candidate.edit),
|
||||
edit: candidate.edit && TypeConverters.WorkspaceEdit.from(candidate.edit),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -814,13 +814,13 @@ export class CodeAction {
|
||||
|
||||
command?: vscode.Command;
|
||||
|
||||
edits?: WorkspaceEdit;
|
||||
edit?: WorkspaceEdit;
|
||||
|
||||
dianostics?: Diagnostic[];
|
||||
|
||||
constructor(title: string, edits?: WorkspaceEdit) {
|
||||
constructor(title: string, edit?: WorkspaceEdit) {
|
||||
this.title = title;
|
||||
this.edits = edits;
|
||||
this.edit = edit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user