mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
Only show infer return type refactoring when refactorings are requested
Fixes #117799
This commit is contained in:
@@ -309,7 +309,15 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const actions = this.convertApplicableRefactors(response.body, document, rangeOrSelection);
|
||||
const actions = this.convertApplicableRefactors(response.body, document, rangeOrSelection).filter(action => {
|
||||
// Don't show 'infer return type' refactoring unless it has been explicitly requested
|
||||
// https://github.com/microsoft/TypeScript/issues/42993
|
||||
if (!context.only && action.kind?.value === 'refactor.rewrite.function.returnType') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
if (!context.only) {
|
||||
return actions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user