Make js/ts quickfix-all action last item in group

fixes #55641
This commit is contained in:
Matt Bierner
2018-09-19 18:09:23 -07:00
parent c0d1f91a8b
commit df411e9db3

View File

@@ -131,22 +131,25 @@ class DiagnosticsSet {
}
class CodeActionSet {
private _actions: vscode.CodeAction[] = [];
private _fixAllActions = new Set<{}>();
private _actions = new Set<vscode.CodeAction>();
private _fixAllActions = new Map<{}, vscode.CodeAction>();
public get values() {
public get values(): Iterable<vscode.CodeAction> {
return this._actions;
}
public addAction(action: vscode.CodeAction) {
this._actions.push(action);
this._actions.add(action);
}
public addFixAllAction(fixId: {}, action: vscode.CodeAction) {
if (!this.hasFixAllAction(fixId)) {
this.addAction(action);
this._fixAllActions.add(fixId);
const existing = this._fixAllActions.get(fixId);
if (existing) {
// reinsert action at back
this._actions.delete(existing);
}
this.addAction(action);
this._fixAllActions.set(fixId, action);
}
public hasFixAllAction(fixId: {}) {