mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Short title for command contribution.
This commit is contained in:
@@ -438,6 +438,7 @@ namespace schema {
|
||||
export interface IUserFriendlyCommand {
|
||||
command: string;
|
||||
title: string | ILocalizedString;
|
||||
shortTitle?: string | ILocalizedString;
|
||||
enablement?: string;
|
||||
category?: string | ILocalizedString;
|
||||
icon?: IUserFriendlyIcon;
|
||||
@@ -457,6 +458,9 @@ namespace schema {
|
||||
if (!isValidLocalizedString(command.title, collector, 'title')) {
|
||||
return false;
|
||||
}
|
||||
if (command.shortTitle && !isValidLocalizedString(command.shortTitle, collector, 'shortTitle')) {
|
||||
return false;
|
||||
}
|
||||
if (command.enablement && typeof command.enablement !== 'string') {
|
||||
collector.error(localize('optstring', "property `{0}` can be omitted or must be of type `string`", 'precondition'));
|
||||
return false;
|
||||
@@ -510,6 +514,10 @@ namespace schema {
|
||||
description: localize('vscode.extension.contributes.commandType.title', 'Title by which the command is represented in the UI'),
|
||||
type: 'string'
|
||||
},
|
||||
shortTitle: {
|
||||
description: localize('vscode.extension.contributes.commandType.shortTitle', 'Short title by which the command is represented in the UI'),
|
||||
type: 'string'
|
||||
},
|
||||
category: {
|
||||
description: localize('vscode.extension.contributes.commandType.category', '(Optional) Category string by the command is grouped in the UI'),
|
||||
type: 'string'
|
||||
@@ -567,7 +575,7 @@ commandsExtensionPoint.setHandler(extensions => {
|
||||
return;
|
||||
}
|
||||
|
||||
const { icon, enablement, category, title, command } = userFriendlyCommand;
|
||||
const { icon, enablement, category, title, shortTitle, command } = userFriendlyCommand;
|
||||
|
||||
let absoluteIcon: { dark: URI; light?: URI; } | ThemeIcon | undefined;
|
||||
if (icon) {
|
||||
@@ -588,6 +596,7 @@ commandsExtensionPoint.setHandler(extensions => {
|
||||
bucket.push({
|
||||
id: command,
|
||||
title,
|
||||
shortTitle,
|
||||
category,
|
||||
precondition: ContextKeyExpr.deserialize(enablement),
|
||||
icon: absoluteIcon
|
||||
|
||||
Reference in New Issue
Block a user