Always run code lens implementations on semantic server (#197578)

Fixes #197286

Already fixed this for references code lens. Just porting it to impl code lens now too
This commit is contained in:
Matt Bierner 2023-11-06 11:05:00 -08:00 committed by GitHub
parent 8ba75dfdc8
commit c57992a973
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,7 @@ import * as typeConverters from '../../typeConverters';
import { ClientCapability, ITypeScriptServiceClient } from '../../typescriptService';
import { conditionalRegistration, requireGlobalConfiguration, requireSomeCapability } from '../util/dependentRegistration';
import { ReferencesCodeLens, TypeScriptBaseCodeLensProvider, getSymbolRange } from './baseCodeLensProvider';
import { ExecutionTarget } from '../../tsServer/server';
export default class TypeScriptImplementationsCodeLensProvider extends TypeScriptBaseCodeLensProvider {
@ -22,7 +23,11 @@ export default class TypeScriptImplementationsCodeLensProvider extends TypeScrip
token: vscode.CancellationToken,
): Promise<vscode.CodeLens> {
const args = typeConverters.Position.toFileLocationRequestArgs(codeLens.file, codeLens.range.start);
const response = await this.client.execute('implementation', args, token, { lowPriority: true, cancelOnResourceChange: codeLens.document });
const response = await this.client.execute('implementation', args, token, {
lowPriority: true,
executionTarget: ExecutionTarget.Semantic,
cancelOnResourceChange: codeLens.document,
});
if (response.type !== 'response' || !response.body) {
codeLens.command = response.type === 'cancelled'
? TypeScriptBaseCodeLensProvider.cancelledCommand