mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Interup getError for refactor and updatePaths on rename
These are user triggered operations that should interupt the background getError requests
This commit is contained in:
@@ -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 response = await this.client.interuptGetErr(() => {
|
||||
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) {
|
||||
return this.client.execute('getEditsForFileRename', args, nulToken);
|
||||
});
|
||||
if (response.type !== 'response' || !response.body) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user