Prototyping new CodeAction API (#36316)

* Add CodeAction Type

Adds skeleton on a new CodeActionType and allows codeActionProvider to return either `Command`s or `CodeAction`s

Move proposed CodeAction API to proposed and try using it in TS

Split CodeAction into quickfix and refactoring classes

Update proposed interface

Update for new API

Adding basic docs

* Support workspace edits and text edits in codeactions

* Remove placeholders

* Resolving conflicts and making PR suggested changes

* Fix quick fix test

* Revert change to only use `CodeAction` instead of `CodeAction | Command` in modes since this will break `vscode.executeCodeActionProvider`
This commit is contained in:
Matt Bierner
2017-11-08 16:07:34 -08:00
committed by GitHub
parent 8a79656f6a
commit be88547c66
23 changed files with 274 additions and 104 deletions

View File

@@ -111,7 +111,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
orderLoop: for (let i = 0; i < 4; i++) {
for (let diagnostic of diagnostics) {
if (diagnostic.severity === order[i]) {
const len = marker.push(DiagnosticCollection._toMarkerData(diagnostic));
const len = marker.push(DiagnosticCollection.toMarkerData(diagnostic));
if (len === DiagnosticCollection._maxDiagnosticsPerFile) {
break orderLoop;
}
@@ -129,7 +129,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
endColumn: marker[marker.length - 1].endColumn
});
} else {
marker = diagnostics.map(DiagnosticCollection._toMarkerData);
marker = diagnostics.map(DiagnosticCollection.toMarkerData);
}
}
@@ -179,7 +179,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
}
}
private static _toMarkerData(diagnostic: vscode.Diagnostic): IMarkerData {
public static toMarkerData(diagnostic: vscode.Diagnostic): IMarkerData {
let range = diagnostic.range;