提交 2efc376a 编写于 作者: J Johannes Rieken 提交者: GitHub

Merge pull request #24469 from mjbvz/allow-title-only-code-lens

Allow Code Lenses to only Provide a Title and no Backing Command 
...@@ -62,7 +62,7 @@ export default class TypeScriptImplementationsCodeLensProvider extends TypeScrip ...@@ -62,7 +62,7 @@ export default class TypeScriptImplementationsCodeLensProvider extends TypeScrip
title: locations.length === 1 title: locations.length === 1
? localize('oneImplementationLabel', '1 implementation') ? localize('oneImplementationLabel', '1 implementation')
: localize('manyImplementationLabel', '{0} implementations', locations.length), : localize('manyImplementationLabel', '{0} implementations', locations.length),
command: 'editor.action.showReferences', command: locations.length ? 'editor.action.showReferences' : '',
arguments: [codeLens.document, codeLens.range.start, locations] arguments: [codeLens.document, codeLens.range.start, locations]
}; };
return codeLens; return codeLens;
......
...@@ -56,7 +56,7 @@ export default class TypeScriptReferencesCodeLensProvider extends TypeScriptBase ...@@ -56,7 +56,7 @@ export default class TypeScriptReferencesCodeLensProvider extends TypeScriptBase
title: locations.length === 1 title: locations.length === 1
? localize('oneReferenceLabel', '1 reference') ? localize('oneReferenceLabel', '1 reference')
: localize('manyReferenceLabel', '{0} references', locations.length), : localize('manyReferenceLabel', '{0} references', locations.length),
command: 'editor.action.showReferences', command: locations.length ? 'editor.action.showReferences' : '',
arguments: [codeLens.document, codeLens.range.start, locations] arguments: [codeLens.document, codeLens.range.start, locations]
}; };
return codeLens; return codeLens;
......
...@@ -181,7 +181,7 @@ export class CommandsConverter { ...@@ -181,7 +181,7 @@ export class CommandsConverter {
title: command.title title: command.title
}; };
if (!isFalsyOrEmpty(command.arguments)) { if (command.command && !isFalsyOrEmpty(command.arguments)) {
// we have a contributed command with arguments. that // we have a contributed command with arguments. that
// means we don't want to send the arguments around // means we don't want to send the arguments around
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册