Extract getCodeLensLabel

This commit is contained in:
Matt Bierner
2018-12-12 18:07:31 -08:00
parent c36794253c
commit 5dc52f0617

View File

@@ -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<vscode.Location>): string {
return locations.length === 1
? localize('oneReferenceLabel', '1 reference')
: localize('manyReferenceLabel', '{0} references', locations.length);
}
protected extractSymbol(
document: vscode.TextDocument,
item: Proto.NavigationTree,