mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +00:00
Extract isPreferredFix
This commit is contained in:
@@ -269,9 +269,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider {
|
|||||||
arguments: [tsAction],
|
arguments: [tsAction],
|
||||||
title: ''
|
title: ''
|
||||||
};
|
};
|
||||||
if (tsAction.fixName === 'spelling') {
|
codeAction.isPreferred = isPreferredFix(tsAction);
|
||||||
codeAction.isPreferred = true;
|
|
||||||
}
|
|
||||||
return codeAction;
|
return codeAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,6 +303,11 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const preferredFixes = new Set(['spelling']);
|
||||||
|
function isPreferredFix(tsAction: Proto.CodeFixAction): boolean {
|
||||||
|
return preferredFixes.has(tsAction.fixName);
|
||||||
|
}
|
||||||
|
|
||||||
export function register(
|
export function register(
|
||||||
selector: vscode.DocumentSelector,
|
selector: vscode.DocumentSelector,
|
||||||
client: ITypeScriptServiceClient,
|
client: ITypeScriptServiceClient,
|
||||||
|
|||||||
Reference in New Issue
Block a user