mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user