mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Allow Code Lenses to Provide only a Title
Fixes #24209 **Bug** Currently, for the js/ts references code lens, even if there are zero references you can click on the lens. This display an empty peek view **Fix** Allow code lenses to only register a title for the lens with no actual backing command
This commit is contained in:
@@ -62,7 +62,7 @@ export default class TypeScriptImplementationsCodeLensProvider extends TypeScrip
|
||||
title: locations.length === 1
|
||||
? localize('oneImplementationLabel', '1 implementation')
|
||||
: localize('manyImplementationLabel', '{0} implementations', locations.length),
|
||||
command: 'editor.action.showReferences',
|
||||
command: locations.length ? 'editor.action.showReferences' : '',
|
||||
arguments: [codeLens.document, codeLens.range.start, locations]
|
||||
};
|
||||
return codeLens;
|
||||
|
||||
@@ -56,7 +56,7 @@ export default class TypeScriptReferencesCodeLensProvider extends TypeScriptBase
|
||||
title: locations.length === 1
|
||||
? localize('oneReferenceLabel', '1 reference')
|
||||
: localize('manyReferenceLabel', '{0} references', locations.length),
|
||||
command: 'editor.action.showReferences',
|
||||
command: locations.length ? 'editor.action.showReferences' : '',
|
||||
arguments: [codeLens.document, codeLens.range.start, locations]
|
||||
};
|
||||
return codeLens;
|
||||
|
||||
Reference in New Issue
Block a user