Prototype auto fixable quick fixes

Part of #62110

- Adds a new field `canAutoApply` to code actions. This field indicates that a code action can be applied without additional user input. For quick fixes, this should be set if the fix properly addresses the error

- Enable auto fixes for TS spelling errors

- Added a `editor.action.autoFix` command to triggers auto fixes at the current cursor position
This commit is contained in:
Matt Bierner
2019-01-16 17:54:04 -08:00
parent b76ea579f6
commit 1904cd8d84
10 changed files with 64 additions and 7 deletions

View File

@@ -864,6 +864,7 @@ export interface CodeActionDto {
diagnostics?: IMarkerData[];
command?: modes.Command;
kind?: string;
canAutoApply?: boolean;
}
export interface ExtHostLanguageFeaturesShape {

View File

@@ -342,7 +342,8 @@ class CodeActionAdapter {
command: candidate.command && this._commands.toInternal(candidate.command),
diagnostics: candidate.diagnostics && candidate.diagnostics.map(typeConvert.Diagnostic.from),
edit: candidate.edit && typeConvert.WorkspaceEdit.from(candidate.edit),
kind: candidate.kind && candidate.kind.value
kind: candidate.kind && candidate.kind.value,
canAutoApply: candidate.canAutoApply,
});
}
}