mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 03:39:23 +00:00
Extract isPreferredFix
This commit is contained in:
@@ -269,9 +269,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider {
|
||||
arguments: [tsAction],
|
||||
title: ''
|
||||
};
|
||||
if (tsAction.fixName === 'spelling') {
|
||||
codeAction.isPreferred = true;
|
||||
}
|
||||
codeAction.isPreferred = isPreferredFix(tsAction);
|
||||
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(
|
||||
selector: vscode.DocumentSelector,
|
||||
client: ITypeScriptServiceClient,
|
||||
|
||||
Reference in New Issue
Block a user