mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
making the filtering function synchronous
This commit is contained in:
parent
a86c36c6b0
commit
5285e1d97e
|
@ -557,7 +557,8 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
|
|||
return undefined;
|
||||
}
|
||||
|
||||
const actions = (await this.convertApplicableRefactors(document, response.body, rangeOrSelection)).filter(async action => {
|
||||
const documentSymbols = await vscode.commands.executeCommand<(vscode.SymbolInformation & vscode.DocumentSymbol)[]>('vscode.executeDocumentSymbolProvider', document.uri);
|
||||
const actions = (await this.convertApplicableRefactors(document, response.body, rangeOrSelection)).filter(action => {
|
||||
if (this.client.apiVersion.lt(API.v430)) {
|
||||
// Don't show 'infer return type' refactoring unless it has been explicitly requested
|
||||
// https://github.com/microsoft/TypeScript/issues/42993
|
||||
|
@ -566,7 +567,6 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
|
|||
}
|
||||
}
|
||||
if (action.kind?.value === Move_NewFile.kind.value) {
|
||||
const documentSymbols = await vscode.commands.executeCommand<(vscode.SymbolInformation & vscode.DocumentSymbol)[]>('vscode.executeDocumentSymbolProvider', document.uri);
|
||||
return MoveToFileCodeAction.shouldIncludeCodeAction(documentSymbols, rangeOrSelection);
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue