mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Interupt TS references and implementations requests
Fixes #60213 These are low priority UI elements and should not block user ui requests that come in, such as completions
This commit is contained in:
@@ -24,7 +24,7 @@ export default class TypeScriptImplementationsCodeLensProvider extends TypeScrip
|
||||
const codeLens = inputCodeLens as ReferencesCodeLens;
|
||||
|
||||
const args = typeConverters.Position.toFileLocationRequestArgs(codeLens.file, codeLens.range.start);
|
||||
const response = await this.client.execute('implementation', args, token);
|
||||
const response = await this.client.execute('implementation', args, token, /* lowPriority */ true);
|
||||
if (response.type !== 'response' || !response.body) {
|
||||
codeLens.command = {
|
||||
title: localize('implementationsErrorLabel', 'Could not determine implementations'),
|
||||
|
||||
@@ -17,12 +17,16 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
class TypeScriptReferencesCodeLensProvider extends TypeScriptBaseCodeLensProvider {
|
||||
|
||||
public resolveCodeLens(inputCodeLens: vscode.CodeLens, token: vscode.CancellationToken): Promise<vscode.CodeLens> {
|
||||
public async resolveCodeLens(inputCodeLens: vscode.CodeLens, token: vscode.CancellationToken): Promise<vscode.CodeLens> {
|
||||
const codeLens = inputCodeLens as ReferencesCodeLens;
|
||||
const args = typeConverters.Position.toFileLocationRequestArgs(codeLens.file, codeLens.range.start);
|
||||
return this.client.execute('references', args, token).then(response => {
|
||||
const response = await this.client.execute('references', args, token, /* lowPriority */ true);
|
||||
if (response.type !== 'response' || !response.body) {
|
||||
throw codeLens;
|
||||
codeLens.command = {
|
||||
title: localize('referenceErrorLabel', 'Could not determine references'),
|
||||
command: ''
|
||||
};
|
||||
return codeLens;
|
||||
}
|
||||
|
||||
const locations = response.body.refs
|
||||
@@ -41,13 +45,6 @@ class TypeScriptReferencesCodeLensProvider extends TypeScriptBaseCodeLensProvide
|
||||
arguments: [codeLens.document, codeLens.range.start, locations]
|
||||
};
|
||||
return codeLens;
|
||||
}).catch(() => {
|
||||
codeLens.command = {
|
||||
title: localize('referenceErrorLabel', 'Could not determine references'),
|
||||
command: ''
|
||||
};
|
||||
return codeLens;
|
||||
});
|
||||
}
|
||||
|
||||
protected extractSymbol(
|
||||
|
||||
Reference in New Issue
Block a user