提交 a87dc2b6 编写于 作者: M Matt Bierner

Interup getError for refactor and updatePaths on rename

These are user triggered operations that should interupt the background getError requests
上级 d02be784
......@@ -137,10 +137,12 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider {
return undefined;
}
await this.formattingOptionsManager.ensureConfigurationForDocument(document, token);
const args: Proto.GetApplicableRefactorsRequestArgs = typeConverters.Range.toFileRangeRequestArgs(file, rangeOrSelection);
const response = await this.client.execute('getApplicableRefactors', args, token);
const response = await this.client.interuptGetErr(() => {
this.formattingOptionsManager.ensureConfigurationForDocument(document, token);
return this.client.execute('getApplicableRefactors', args, token);
});
if (response.type !== 'response' || !response.body) {
return undefined;
}
......
......@@ -230,21 +230,19 @@ class UpdateImportsOnFileRenameHandler extends Disposable {
document: vscode.TextDocument,
oldFile: string,
newFile: string,
) {
): Promise<vscode.WorkspaceEdit | undefined> {
const isDirectoryRename = fs.lstatSync(newFile).isDirectory();
await this.fileConfigurationManager.setGlobalConfigurationFromDocument(document, nulToken);
const args: Proto.GetEditsForFileRenameRequestArgs & { file: string } = {
file: targetResource,
oldFilePath: oldFile,
newFilePath: newFile,
};
const response = await this.client.execute('getEditsForFileRename', args, nulToken);
if (response.type !== 'response') {
return;
}
if (!response.body) {
const response = await this.client.interuptGetErr(() => {
this.fileConfigurationManager.setGlobalConfigurationFromDocument(document, nulToken);
const args: Proto.GetEditsForFileRenameRequestArgs & { file: string } = {
file: targetResource,
oldFilePath: oldFile,
newFilePath: newFile,
};
return this.client.execute('getEditsForFileRename', args, nulToken);
});
if (response.type !== 'response' || !response.body) {
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册