diff --git a/extensions/typescript-language-features/src/features/referencesCodeLens.ts b/extensions/typescript-language-features/src/features/referencesCodeLens.ts index e08755b8805..7c256e3064f 100644 --- a/extensions/typescript-language-features/src/features/referencesCodeLens.ts +++ b/extensions/typescript-language-features/src/features/referencesCodeLens.ts @@ -38,15 +38,19 @@ class TypeScriptReferencesCodeLensProvider extends TypeScriptBaseCodeLensProvide location.range.start.isEqual(codeLens.range.start))); codeLens.command = { - title: locations.length === 1 - ? localize('oneReferenceLabel', '1 reference') - : localize('manyReferenceLabel', '{0} references', locations.length), + title: this.getCodeLensLabel(locations), command: locations.length ? 'editor.action.showReferences' : '', arguments: [codeLens.document, codeLens.range.start, locations] }; return codeLens; } + private getCodeLensLabel(locations: ReadonlyArray): string { + return locations.length === 1 + ? localize('oneReferenceLabel', '1 reference') + : localize('manyReferenceLabel', '{0} references', locations.length); + } + protected extractSymbol( document: vscode.TextDocument, item: Proto.NavigationTree,