Skip to content

Commit

Permalink
Fix #48563
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Apr 25, 2018
1 parent 2c49115 commit 1fbff4e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/vs/workbench/api/browser/viewsContainersExtensionPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ const viewsContainerSchema: IJSONSchema = {
properties: {
id: {
description: localize({ key: 'vscode.extension.contributes.views.containers.id', comment: ['Contribution refers to those that an extension contributes to VS Code through an extension/contribution point. '] }, "Unique id used to identify the container in which views can be contributed using 'views' contribution point"),
type: 'string'
type: 'string',
pattern: '^[a-zA-Z0-9_-]+$'
},
label: {
description: localize('vscode.extension.contributes.views.containers.title', 'Human readable string used to render the container'),
Expand Down Expand Up @@ -104,7 +105,11 @@ class ViewsContainersExtensionHandler implements IWorkbenchContribution {

for (let descriptor of viewsContainersDescriptors) {
if (typeof descriptor.id !== 'string') {
collector.error(localize('requirestring', "property `{0}` is mandatory and must be of type `string`", 'id'));
collector.error(localize('requireidstring', "property `{0}` is mandatory and must be of type `string`. Allowed only alphanumeric letters, '_', '-'.", 'id'));
return false;
}
if (!(/^[a-z0-9_-]+$/i.test(descriptor.id))) {
collector.error(localize('requireidstring', "property `{0}` is mandatory and must be of type `string`. Allowed only alphanumeric letters, '_', '-'.", 'id'));
return false;
}
if (typeof descriptor.title !== 'string') {
Expand Down

0 comments on commit 1fbff4e

Please sign in to comment.