提交 a7def72d 编写于 作者: M Martin Aeschlimann

trailing commas only for setting files

上级 da8c3e70
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"dependencies": { "dependencies": {
"jsonc-parser": "^2.1.1", "jsonc-parser": "^2.1.1",
"request-light": "^0.2.4", "request-light": "^0.2.4",
"vscode-json-languageservice": "^3.3.2", "vscode-json-languageservice": "^3.3.3",
"vscode-languageserver": "^5.3.0-next.8", "vscode-languageserver": "^5.3.0-next.8",
"vscode-nls": "^4.1.1", "vscode-nls": "^4.1.1",
"vscode-uri": "^2.0.3" "vscode-uri": "^2.0.3"
......
...@@ -312,7 +312,7 @@ function validateTextDocument(textDocument: TextDocument, callback?: (diagnostic ...@@ -312,7 +312,7 @@ function validateTextDocument(textDocument: TextDocument, callback?: (diagnostic
const jsonDocument = getJSONDocument(textDocument); const jsonDocument = getJSONDocument(textDocument);
const version = textDocument.version; const version = textDocument.version;
const documentSettings: DocumentLanguageSettings = textDocument.languageId === 'jsonc' ? { comments: 'ignore', trailingCommas: 'ignore' } : { comments: 'error', trailingCommas: 'error' }; const documentSettings: DocumentLanguageSettings = textDocument.languageId === 'jsonc' ? { comments: 'ignore', trailingCommas: 'warning' } : { comments: 'error', trailingCommas: 'error' };
languageService.doValidation(textDocument, jsonDocument, documentSettings).then(diagnostics => { languageService.doValidation(textDocument, jsonDocument, documentSettings).then(diagnostics => {
setTimeout(() => { setTimeout(() => {
const currDocument = documents.get(textDocument.uri); const currDocument = documents.get(textDocument.uri);
......
...@@ -73,10 +73,10 @@ request-light@^0.2.4: ...@@ -73,10 +73,10 @@ request-light@^0.2.4:
https-proxy-agent "^2.2.1" https-proxy-agent "^2.2.1"
vscode-nls "^4.0.0" vscode-nls "^4.0.0"
vscode-json-languageservice@^3.3.2: vscode-json-languageservice@^3.3.3:
version "3.3.2" version "3.3.3"
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.2.tgz#2b241b73ead75b001bf90ee5107b1b0a4e47737c" resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.3.tgz#f7e512a2cd5e82fecbebf507d6fceaea47661297"
integrity sha512-+TXVA8KsIzPOZIBV4lI8S/460XihqL26N9hyH7wMOCbEA06W/zfmlZhHSmSJ/Nun9Q/CGLJYZKw4xn+vcuI62A== integrity sha512-5vL3OXTUuQpn6+tGd47dopio+7WwbtIZ07zfYMzAUX8eVWPZjfEsLeSWmQk5Xw+vwgu+j5zC4koz5UofLDGGRA==
dependencies: dependencies:
jsonc-parser "^2.1.1" jsonc-parser "^2.1.1"
vscode-languageserver-types "^3.15.0-next.2" vscode-languageserver-types "^3.15.0-next.2"
......
...@@ -50,8 +50,7 @@ ...@@ -50,8 +50,7 @@
".babelrc", ".babelrc",
".jsonc", ".jsonc",
".eslintrc", ".eslintrc",
".eslintrc.json", ".eslintrc.json"
"tslint.json"
], ],
"configuration": "./language-configuration.json" "configuration": "./language-configuration.json"
} }
......
...@@ -61,6 +61,7 @@ export interface IJSONSchema { ...@@ -61,6 +61,7 @@ export interface IJSONSchema {
markdownDescription?: string; // VSCode extension markdownDescription?: string; // VSCode extension
doNotSuggest?: boolean; // VSCode extension doNotSuggest?: boolean; // VSCode extension
allowComments?: boolean; // VSCode extension allowComments?: boolean; // VSCode extension
allowsTrailingCommas?: boolean; // VSCode extension
} }
export interface IJSONSchemaMap { export interface IJSONSchemaMap {
......
...@@ -26,7 +26,13 @@ ...@@ -26,7 +26,13 @@
amdLoader(['vs/workbench/workbench.web.api'], function (api) { amdLoader(['vs/workbench/workbench.web.api'], function (api) {
const options = JSON.parse(document.getElementById('vscode-workbench-web-configuration').getAttribute('data-settings')); const options = JSON.parse(document.getElementById('vscode-workbench-web-configuration').getAttribute('data-settings'));
options.staticExtensions = [{
packageJSON: JSON.parse('{"name":"errorlens","displayName":"Error Lens","description":"Improve highlighting of errors, warnings and other language diagnostics.","version":"2.7.0","publisher":"usernamehw","license":"MIT","engines":{"vscode":"^1.30.0"},"categories":["Other"],"keywords":["highlight","problems","error","warning","diagnostics","gutter","multi-root ready"],"galleryBanner":{"color":"#332020","theme":"dark"},"icon":"img/icon.png","repository":{"type":"git","url":"https://github.com/usernamehw/vscode-error-lens"},"activationEvents":["*"],"main":"./dist/extension","contributes":{"commands":[{"command":"errorLens.toggle","title":"Toggle (Enable/Disable) All Decorations","category":"Error Lens"},{"command":"errorLens.toggleError","title":"Toggle Errors","category":"Error Lens"},{"command":"errorLens.toggleWarning","title":"Toggle Warnings","category":"Error Lens"},{"command":"errorLens.toggleInfo","title":"Toggle Info","category":"Error Lens"},{"command":"errorLens.toggleHint","title":"Toggle Hint","category":"Error Lens"},{"command":"errorLens.copyProblemMessage","title":"Copy Problem Message","category":"Error Lens"}],"configuration":{"properties":{"errorLens.errorBackground":{"type":"string","default":"#e4545420","description":"Background color used to highlight lines containing errors."},"errorLens.errorForeground":{"type":"string","default":"#e45454","description":"Text color used to highlight lines containing errors."},"errorLens.warningBackground":{"type":"string","default":"#ff942f20","description":"Background color used to highlight lines containing warnings."},"errorLens.warningForeground":{"type":"string","default":"#ff942f","description":"Text color used to highlight lines containing warnings."},"errorLens.infoBackground":{"type":"string","default":"#00b7e420","description":"Background color used to highlight lines containing info."},"errorLens.infoForeground":{"type":"string","default":"#00b7e4","description":"Text color used to highlight lines containing info."},"errorLens.hintBackground":{"type":"string","default":"#17a2a220","description":"Background color used to highlight lines containing hints."},"errorLens.hintForeground":{"type":"string","default":"#17a2a2","description":"Text color used to highlight lines containing hints."},"errorLens.fontFamily":{"type":"string","default":"","description":"Font family of problem messages."},"errorLens.fontWeight":{"type":"string","enum":["100","200","300","400","normal","500","600","700","bold","800","900"],"default":"normal","description":"Specifies the font weight for ErrorLens annotations."},"errorLens.fontStyleItalic":{"type":"boolean","default":false,"description":"Show ErrorLens annotations in Italics, or not?"},"errorLens.fontSize":{"type":"string","default":"","description":"Font size for text (problem messages)."},"errorLens.margin":{"type":"string","default":"30px","description":"Distance between the end of the line and the start of annotation. (CSS units)"},"errorLens.enabledDiagnosticLevels":{"type":"array","items":{"type":"string","enum":["error","warning","info","hint"]},"description":"Specify which diagnostic levels are enhanced. e.g. [ \'error\', \'warning\' ]. Valid values are any or all of: \'error\', \'warning\', \'info\' & \'hint\'","default":["error","warning","info","hint"]},"errorLens.addAnnotationTextPrefixes":{"type":"boolean","description":"If \'true\', prefixes the diagnostic severity (\'ERROR:\', \'WARNING:\' etc) to ErrorLens annotations.","default":false},"errorLens.exclude":{"type":"array","default":[],"items":{"oneOf":[{"type":"string"},{"type":"object","properties":{"code":{"type":"string"},"source":{"type":"string"}}}]},"description":"Specify messages that should not be highlighted."},"errorLens.light":{"type":"object","description":"Specify color of decorations for when the light color theme is active.","properties":{"errorBackground":{"type":"string","default":"","description":"Background color used to highlight lines containing errors."},"errorForeground":{"type":"string","default":"","description":"Text color used to highlight lines containing errors."},"warningBackground":{"type":"string","default":"","description":"Background color used to highlight lines containing warnings."},"warningForeground":{"type":"string","default":"","description":"Text color used to highlight lines containing warnings."},"infoBackground":{"type":"string","default":"","description":"Background color used to highlight lines containing info."},"infoForeground":{"type":"string","default":"","description":"Text color used to highlight lines containing info."},"hintBackground":{"type":"string","default":"","description":"Background color used to highlight lines containing hints."},"hintForeground":{"type":"string","default":"","description":"Text color used to highlight lines containing hints."},"errorGutterIconPath":{"type":"string","description":"Absolute path to error gutter icon for light themes."},"warningGutterIconPath":{"type":"string","description":"Absolute path to warning gutter icon for light themes."},"infoGutterIconPath":{"type":"string","description":"Absolute path to info gutter icon for light themes."},"errorGutterIconColor":{"type":"string","default":"#e45454","markdownDescription":"Error color of `circle` gutter icon set for light themes."},"warningGutterIconColor":{"type":"string","default":"#ff942f","markdownDescription":"Warning color of `circle` gutter icon set for light themes."},"infoGutterIconColor":{"type":"string","default":"#00b7e4","markdownDescription":"Info color of `circle` gutter icon set for light themes."}}},"errorLens.delay":{"type":"number","description":"Delay before showing problem decorations.","default":0},"errorLens.clearDecorations":{"type":"boolean","markdownDescription":"Works only when `delay` is set. When set to `true` extension clears all decorations at the time when diagnostic changes (but it could cause flickering if the delay is < 500). When set to `false` - decorations are not cleared and delay applied to clearing decorations also (but that causes messages being on screen even if the problem was solved).","default":false},"errorLens.onSave":{"type":"boolean","description":"If `true` - update decorations only on save.","default":false},"errorLens.followCursor":{"type":"string","enum":["allLines","activeLine","closestProblem"],"enumDescriptions":["Highlight all problems in file","Highlight only the problem at the cursor","Highlight only closest to the cursor problem"],"description":"Highlight only portion of the problems.","default":"allLines"},"errorLens.followCursorMore":{"type":"number","markdownDescription":"Augments `followCursor`.\\nAdds number of lines to top and bottom when `followCursor` is `activeLine`.\\n Adds number of closest problems when `followCursor` is `closestProblem`","default":0},"errorLens.gutterIconsEnabled":{"type":"boolean","description":"If `true` - show error/warning/info icons in the gutter (In place of debug breakpoint icon).","default":false},"errorLens.gutterIconSize":{"type":"string","markdownDescription":"Change gutter icon size. Examples: `auto`, `contain`, `cover`, `50%`, `150%`","default":"100%"},"errorLens.gutterIconSet":{"type":"string","description":"Change gutter icon style.","enum":["default","borderless","circle"],"enumDescriptions":["Should be similar to vscode icons in Problems Panel.","Should be similar to vscode icons in Problems Panel only without a border.","A simple filled circle."],"default":"default"},"errorLens.errorGutterIconPath":{"type":"string","description":"Absolute path to error gutter icon."},"errorLens.warningGutterIconPath":{"type":"string","description":"Absolute path to warning gutter icon."},"errorLens.infoGutterIconPath":{"type":"string","description":"Absolute path to info gutter icon."},"errorLens.errorGutterIconColor":{"type":"string","default":"#e45454","markdownDescription":"Error color of `circle` gutter icon set."},"errorLens.warningGutterIconColor":{"type":"string","default":"#ff942f","markdownDescription":"Warning color of `circle` gutter icon set."},"errorLens.infoGutterIconColor":{"type":"string","default":"#00b7e4","markdownDescription":"Info color of `circle` gutter icon set."},"errorLens.editorActiveTabDecorationEnabled":{"type":"boolean","default":false,"markdownDescription":"When `true` - updates `tab.activeBackground` if the file has errors"},"errorLens.editorActiveTabErrorBackground":{"type":"string","default":null,"markdownDescription":""},"errorLens.editorActiveTabWarningBackground":{"type":"string","default":null,"markdownDescription":""}}}},"scripts":{"vscode:prepublish":"webpack --mode production --colors","compile":"webpack --mode development","watch":"webpack --mode development --watch --display=minimal"},"devDependencies":{"@types/lodash":"^4.14.136","@types/node":"^10.14.12","@types/vscode":"^1.30.0","friendly-errors-webpack-plugin":"^1.7.0","ts-loader":"^6.0.4","tslint":"^5.18.0","typescript":"^3.5.3","webpack":"^4.35.3","webpack-cli":"^3.3.5","webpack-strip-block":"^0.2.0"},"dependencies":{"lodash":"^4.17.14"},"__metadata":{"id":"9d8c32ab-354c-4daf-a9bf-20b633734435","publisherId":"151820df-5dc5-4c97-8751-eb84643203fa","publisherDisplayName":"Alexander"}}'),
extensionLocation: { scheme: 'https', authority: 'jriekenextensionscdn.blob.core.windows.net', path: '/$web/usernamehw.errorlens-2.7.0' }
}, {
packageJSON: JSON.parse('{"name":"helloworld","displayName":"HelloWorld","description":"","publisher":"jrieken","version":"0.0.8","engines":{"vscode":"^1.33.0"},"categories":["Other"],"activationEvents":["onCommand:extension.hellowebworker"],"main":"./out/extension.js","contributes":{"commands":[{"command":"extension.hellowebworker","title":"Hello Webworker","icon":"./icons/tree-collapsed-light.svg"}],"menus":{"editor/title":[{"command":"extension.hellowebworker","group":"navigation"}]},"snippets":[{"path":"snippets/foo.code-snippets"}]},"scripts":{"vscode:prepublish":"npm run compile","compile":"tsc -p ./","watch":"tsc -watch -p ./","postinstall":"node ./node_modules/vscode/bin/install","test":"npm run compile && node ./node_modules/vscode/bin/test"},"devDependencies":{"typescript":"^3.3.1","vscode":"^1.1.28","tslint":"^5.12.1","@types/node":"^10.12.21","@types/mocha":"^2.2.42"}}'),
extensionLocation: { scheme: 'https', authority: 'jriekenextensionscdn.blob.core.windows.net', path: '/$web/jrieken.helloworld-0.0.8' }
}];
api.create(document.body, options); api.create(document.body, options);
}); });
})(); })();
...@@ -170,7 +170,7 @@ class ConfigurationRegistry implements IConfigurationRegistry { ...@@ -170,7 +170,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
properties: {} properties: {}
}; };
this.configurationContributors = [this.defaultOverridesConfigurationNode]; this.configurationContributors = [this.defaultOverridesConfigurationNode];
this.editorConfigurationSchema = { properties: {}, patternProperties: {}, additionalProperties: false, errorMessage: 'Unknown editor configuration setting' }; this.editorConfigurationSchema = { properties: {}, patternProperties: {}, additionalProperties: false, errorMessage: 'Unknown editor configuration setting', allowsTrailingCommas: true, allowComments: true };
this.configurationProperties = {}; this.configurationProperties = {};
this.excludedConfigurationProperties = {}; this.excludedConfigurationProperties = {};
this.computeOverridePropertyPattern(); this.computeOverridePropertyPattern();
......
...@@ -238,6 +238,7 @@ function validateProperties(configuration: IConfigurationNode, extension: IExten ...@@ -238,6 +238,7 @@ function validateProperties(configuration: IConfigurationNode, extension: IExten
const jsonRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution); const jsonRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);
jsonRegistry.registerSchema('vscode://schemas/workspaceConfig', { jsonRegistry.registerSchema('vscode://schemas/workspaceConfig', {
allowComments: true, allowComments: true,
allowsTrailingCommas: true,
default: { default: {
folders: [ folders: [
{ {
......
...@@ -358,6 +358,7 @@ export class LanguageConfigurationFileHandler { ...@@ -358,6 +358,7 @@ export class LanguageConfigurationFileHandler {
const schemaId = 'vscode://schemas/language-configuration'; const schemaId = 'vscode://schemas/language-configuration';
const schema: IJSONSchema = { const schema: IJSONSchema = {
allowComments: true, allowComments: true,
allowsTrailingCommas: true,
default: { default: {
comments: { comments: {
blockComment: ['/*', '*/'], blockComment: ['/*', '*/'],
......
...@@ -137,6 +137,8 @@ export const launchSchema: IJSONSchema = { ...@@ -137,6 +137,8 @@ export const launchSchema: IJSONSchema = {
id: launchSchemaId, id: launchSchemaId,
type: 'object', type: 'object',
title: nls.localize('app.launch.json.title', "Launch"), title: nls.localize('app.launch.json.title', "Launch"),
allowsTrailingCommas: true,
allowComments: true,
required: [], required: [],
default: { version: '0.2.0', configurations: [], compounds: [] }, default: { version: '0.2.0', configurations: [], compounds: [] },
properties: { properties: {
......
...@@ -11,6 +11,7 @@ export const ExtensionsConfigurationSchemaId = 'vscode://schemas/extensions'; ...@@ -11,6 +11,7 @@ export const ExtensionsConfigurationSchemaId = 'vscode://schemas/extensions';
export const ExtensionsConfigurationSchema: IJSONSchema = { export const ExtensionsConfigurationSchema: IJSONSchema = {
id: ExtensionsConfigurationSchemaId, id: ExtensionsConfigurationSchemaId,
allowComments: true, allowComments: true,
allowsTrailingCommas: true,
type: 'object', type: 'object',
title: localize('app.extensions.json.title', "Extensions"), title: localize('app.extensions.json.title', "Extensions"),
additionalProperties: false, additionalProperties: false,
...@@ -50,4 +51,4 @@ export const ExtensionsConfigurationInitialContent: string = [ ...@@ -50,4 +51,4 @@ export const ExtensionsConfigurationInitialContent: string = [
'\t\t', '\t\t',
'\t]', '\t]',
'}' '}'
].join('\n'); ].join('\n');
\ No newline at end of file
...@@ -232,6 +232,7 @@ function registerLocaleDefinitionSchema(languages: string[]): void { ...@@ -232,6 +232,7 @@ function registerLocaleDefinitionSchema(languages: string[]): void {
jsonRegistry.registerSchema(localeDefinitionFileSchemaId, { jsonRegistry.registerSchema(localeDefinitionFileSchemaId, {
id: localeDefinitionFileSchemaId, id: localeDefinitionFileSchemaId,
allowComments: true, allowComments: true,
allowsTrailingCommas: true,
description: 'Locale Definition file', description: 'Locale Definition file',
type: 'object', type: 'object',
default: { default: {
......
...@@ -28,6 +28,7 @@ const languageScopeSchemaId = 'vscode://schemas/snippets'; ...@@ -28,6 +28,7 @@ const languageScopeSchemaId = 'vscode://schemas/snippets';
const languageScopeSchema: IJSONSchema = { const languageScopeSchema: IJSONSchema = {
id: languageScopeSchemaId, id: languageScopeSchemaId,
allowComments: true, allowComments: true,
allowsTrailingCommas: true,
defaultSnippets: [{ defaultSnippets: [{
label: nls.localize('snippetSchema.json.default', "Empty snippet"), label: nls.localize('snippetSchema.json.default', "Empty snippet"),
body: { '${1:snippetName}': { 'prefix': '${2:prefix}', 'body': '${3:snippet}', 'description': '${4:description}' } } body: { '${1:snippetName}': { 'prefix': '${2:prefix}', 'body': '${3:snippet}', 'description': '${4:description}' } }
...@@ -63,6 +64,7 @@ const globalSchemaId = 'vscode://schemas/global-snippets'; ...@@ -63,6 +64,7 @@ const globalSchemaId = 'vscode://schemas/global-snippets';
const globalSchema: IJSONSchema = { const globalSchema: IJSONSchema = {
id: globalSchemaId, id: globalSchemaId,
allowComments: true, allowComments: true,
allowsTrailingCommas: true,
defaultSnippets: [{ defaultSnippets: [{
label: nls.localize('snippetSchema.json.default', "Empty snippet"), label: nls.localize('snippetSchema.json.default', "Empty snippet"),
body: { '${1:snippetName}': { 'scope': '${2:scope}', 'prefix': '${3:prefix}', 'body': '${4:snippet}', 'description': '${5:description}' } } body: { '${1:snippetName}': { 'scope': '${2:scope}', 'prefix': '${3:prefix}', 'body': '${4:snippet}', 'description': '${5:description}' } }
......
...@@ -260,6 +260,8 @@ let schema: IJSONSchema = { ...@@ -260,6 +260,8 @@ let schema: IJSONSchema = {
id: schemaId, id: schemaId,
description: 'Task definition file', description: 'Task definition file',
type: 'object', type: 'object',
allowsTrailingCommas: true,
allowComments: true,
default: { default: {
version: '2.0.0', version: '2.0.0',
tasks: [ tasks: [
......
...@@ -507,17 +507,17 @@ export class WorkspaceService extends Disposable implements IConfigurationServic ...@@ -507,17 +507,17 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
private registerConfigurationSchemas(): void { private registerConfigurationSchemas(): void {
if (this.workspace) { if (this.workspace) {
const jsonRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution); const jsonRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);
const allSettingsSchema: IJSONSchema = { properties: allSettings.properties, patternProperties: allSettings.patternProperties, additionalProperties: true }; const allSettingsSchema: IJSONSchema = { properties: allSettings.properties, patternProperties: allSettings.patternProperties, additionalProperties: true, allowsTrailingCommas: true, allowComments: true };
const userSettingsSchema: IJSONSchema = this.remoteUserConfiguration ? { properties: { ...applicationSettings.properties, ...windowSettings.properties, ...resourceSettings.properties }, patternProperties: allSettings.patternProperties, additionalProperties: true } : allSettingsSchema; const userSettingsSchema: IJSONSchema = this.remoteUserConfiguration ? { properties: { ...applicationSettings.properties, ...windowSettings.properties, ...resourceSettings.properties }, patternProperties: allSettings.patternProperties, additionalProperties: true, allowsTrailingCommas: true, allowComments: true } : allSettingsSchema;
const machineSettingsSchema: IJSONSchema = { properties: { ...machineSettings.properties, ...machineOverridableSettings.properties, ...windowSettings.properties, ...resourceSettings.properties }, patternProperties: allSettings.patternProperties, additionalProperties: true }; const machineSettingsSchema: IJSONSchema = { properties: { ...machineSettings.properties, ...machineOverridableSettings.properties, ...windowSettings.properties, ...resourceSettings.properties }, patternProperties: allSettings.patternProperties, additionalProperties: true, allowsTrailingCommas: true, allowComments: true };
const workspaceSettingsSchema: IJSONSchema = { properties: { ...machineOverridableSettings.properties, ...windowSettings.properties, ...resourceSettings.properties }, patternProperties: allSettings.patternProperties, additionalProperties: true }; const workspaceSettingsSchema: IJSONSchema = { properties: { ...machineOverridableSettings.properties, ...windowSettings.properties, ...resourceSettings.properties }, patternProperties: allSettings.patternProperties, additionalProperties: true, allowsTrailingCommas: true, allowComments: true };
jsonRegistry.registerSchema(defaultSettingsSchemaId, allSettingsSchema); jsonRegistry.registerSchema(defaultSettingsSchemaId, allSettingsSchema);
jsonRegistry.registerSchema(userSettingsSchemaId, userSettingsSchema); jsonRegistry.registerSchema(userSettingsSchemaId, userSettingsSchema);
jsonRegistry.registerSchema(machineSettingsSchemaId, machineSettingsSchema); jsonRegistry.registerSchema(machineSettingsSchemaId, machineSettingsSchema);
if (WorkbenchState.WORKSPACE === this.getWorkbenchState()) { if (WorkbenchState.WORKSPACE === this.getWorkbenchState()) {
const folderSettingsSchema: IJSONSchema = { properties: { ...machineOverridableSettings.properties, ...resourceSettings.properties }, patternProperties: allSettings.patternProperties, additionalProperties: true }; const folderSettingsSchema: IJSONSchema = { properties: { ...machineOverridableSettings.properties, ...resourceSettings.properties }, patternProperties: allSettings.patternProperties, additionalProperties: true, allowsTrailingCommas: true, allowComments: true };
jsonRegistry.registerSchema(workspaceSettingsSchemaId, workspaceSettingsSchema); jsonRegistry.registerSchema(workspaceSettingsSchemaId, workspaceSettingsSchema);
jsonRegistry.registerSchema(folderSettingsSchemaId, folderSettingsSchema); jsonRegistry.registerSchema(folderSettingsSchemaId, folderSettingsSchema);
} else { } else {
......
...@@ -602,10 +602,12 @@ let commandsSchemas: IJSONSchema[] = []; ...@@ -602,10 +602,12 @@ let commandsSchemas: IJSONSchema[] = [];
let commandsEnum: string[] = []; let commandsEnum: string[] = [];
let commandsEnumDescriptions: (string | undefined)[] = []; let commandsEnumDescriptions: (string | undefined)[] = [];
let schema: IJSONSchema = { let schema: IJSONSchema = {
'id': schemaId, id: schemaId,
'type': 'array', type: 'array',
'title': nls.localize('keybindings.json.title', "Keybindings configuration"), title: nls.localize('keybindings.json.title', "Keybindings configuration"),
'definitions': { allowsTrailingCommas: true,
allowComments: true,
definitions: {
'editorGroupsSchema': { 'editorGroupsSchema': {
'type': 'array', 'type': 'array',
'items': { 'items': {
...@@ -623,7 +625,7 @@ let schema: IJSONSchema = { ...@@ -623,7 +625,7 @@ let schema: IJSONSchema = {
} }
} }
}, },
'items': { items: {
'required': ['key'], 'required': ['key'],
'type': 'object', 'type': 'object',
'defaultSnippets': [{ 'body': { 'key': '$1', 'command': '$2', 'when': '$3' } }], 'defaultSnippets': [{ 'body': { 'key': '$1', 'command': '$2', 'when': '$3' } }],
......
...@@ -192,6 +192,7 @@ export const colorThemeSchemaId = 'vscode://schemas/color-theme'; ...@@ -192,6 +192,7 @@ export const colorThemeSchemaId = 'vscode://schemas/color-theme';
const colorThemeSchema: IJSONSchema = { const colorThemeSchema: IJSONSchema = {
type: 'object', type: 'object',
allowComments: true, allowComments: true,
allowsTrailingCommas: true,
properties: { properties: {
colors: { colors: {
description: nls.localize('schema.workbenchColors', 'Colors in the workbench'), description: nls.localize('schema.workbenchColors', 'Colors in the workbench'),
......
...@@ -12,6 +12,7 @@ const schemaId = 'vscode://schemas/icon-theme'; ...@@ -12,6 +12,7 @@ const schemaId = 'vscode://schemas/icon-theme';
const schema: IJSONSchema = { const schema: IJSONSchema = {
type: 'object', type: 'object',
allowComments: true, allowComments: true,
allowsTrailingCommas: true,
definitions: { definitions: {
folderExpanded: { folderExpanded: {
type: 'string', type: 'string',
...@@ -221,4 +222,4 @@ const schema: IJSONSchema = { ...@@ -221,4 +222,4 @@ const schema: IJSONSchema = {
export function registerFileIconThemeSchemas() { export function registerFileIconThemeSchemas() {
let schemaRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution); let schemaRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);
schemaRegistry.registerSchema(schemaId, schema); schemaRegistry.registerSchema(schemaId, schema);
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册