diff --git a/extensions/json-language-features/server/package.json b/extensions/json-language-features/server/package.json index d05f3c36e231e85c510f0b866a53419a53caceac..6d99b5f84a4b5797c5b6c23772b41f174cde2414 100644 --- a/extensions/json-language-features/server/package.json +++ b/extensions/json-language-features/server/package.json @@ -14,7 +14,7 @@ "dependencies": { "jsonc-parser": "^2.1.1", "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-nls": "^4.1.1", "vscode-uri": "^2.0.3" diff --git a/extensions/json-language-features/server/src/jsonServerMain.ts b/extensions/json-language-features/server/src/jsonServerMain.ts index ba1c7a185187a3233f37fbeee4869a038b288c28..c741c03e3ea1a6d17c0fc0d33b596b0422f4bf44 100644 --- a/extensions/json-language-features/server/src/jsonServerMain.ts +++ b/extensions/json-language-features/server/src/jsonServerMain.ts @@ -312,7 +312,7 @@ function validateTextDocument(textDocument: TextDocument, callback?: (diagnostic const jsonDocument = getJSONDocument(textDocument); 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 => { setTimeout(() => { const currDocument = documents.get(textDocument.uri); diff --git a/extensions/json-language-features/server/yarn.lock b/extensions/json-language-features/server/yarn.lock index 20ad7ebfaef52bb2d0366ba4ad77a58b08a983d1..12e39de96af2c776b52d15efea18ea802b784cc2 100644 --- a/extensions/json-language-features/server/yarn.lock +++ b/extensions/json-language-features/server/yarn.lock @@ -73,10 +73,10 @@ request-light@^0.2.4: https-proxy-agent "^2.2.1" vscode-nls "^4.0.0" -vscode-json-languageservice@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.2.tgz#2b241b73ead75b001bf90ee5107b1b0a4e47737c" - integrity sha512-+TXVA8KsIzPOZIBV4lI8S/460XihqL26N9hyH7wMOCbEA06W/zfmlZhHSmSJ/Nun9Q/CGLJYZKw4xn+vcuI62A== +vscode-json-languageservice@^3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.3.tgz#f7e512a2cd5e82fecbebf507d6fceaea47661297" + integrity sha512-5vL3OXTUuQpn6+tGd47dopio+7WwbtIZ07zfYMzAUX8eVWPZjfEsLeSWmQk5Xw+vwgu+j5zC4koz5UofLDGGRA== dependencies: jsonc-parser "^2.1.1" vscode-languageserver-types "^3.15.0-next.2" diff --git a/extensions/json/package.json b/extensions/json/package.json index e23e86b14a6e5a94e3b0f2961a0858f4f6b32fac..6ef4b97169148bf5e3733a48ae6b700da389f5cf 100644 --- a/extensions/json/package.json +++ b/extensions/json/package.json @@ -50,8 +50,7 @@ ".babelrc", ".jsonc", ".eslintrc", - ".eslintrc.json", - "tslint.json" + ".eslintrc.json" ], "configuration": "./language-configuration.json" } diff --git a/src/vs/base/common/jsonSchema.ts b/src/vs/base/common/jsonSchema.ts index 8014969d958ecb90e564d46cb8ea16c35937c905..380b4be97b41d6b8915795ae1b19910d69150251 100644 --- a/src/vs/base/common/jsonSchema.ts +++ b/src/vs/base/common/jsonSchema.ts @@ -61,6 +61,7 @@ export interface IJSONSchema { markdownDescription?: string; // VSCode extension doNotSuggest?: boolean; // VSCode extension allowComments?: boolean; // VSCode extension + allowsTrailingCommas?: boolean; // VSCode extension } export interface IJSONSchemaMap { diff --git a/src/vs/code/browser/workbench/workbench.js b/src/vs/code/browser/workbench/workbench.js index 5687627518e66bef9119df2f4efab9f8463e75ac..f60713d565ee6c8bd450848e5ecb3ce0a1f3b081 100644 --- a/src/vs/code/browser/workbench/workbench.js +++ b/src/vs/code/browser/workbench/workbench.js @@ -26,7 +26,13 @@ amdLoader(['vs/workbench/workbench.web.api'], function (api) { 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); }); })(); diff --git a/src/vs/platform/configuration/common/configurationRegistry.ts b/src/vs/platform/configuration/common/configurationRegistry.ts index 0b16a8999d7fbb1f0bd96c85d4e8fac6fe72e858..dcec2f72663f88afca9ed60ca6502a5543738823 100644 --- a/src/vs/platform/configuration/common/configurationRegistry.ts +++ b/src/vs/platform/configuration/common/configurationRegistry.ts @@ -170,7 +170,7 @@ class ConfigurationRegistry implements IConfigurationRegistry { properties: {} }; 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.excludedConfigurationProperties = {}; this.computeOverridePropertyPattern(); diff --git a/src/vs/workbench/api/common/configurationExtensionPoint.ts b/src/vs/workbench/api/common/configurationExtensionPoint.ts index 1ca761922ac9cdcd55ab71a34085a58ce7a762c1..cd1670427df5c36130b97f5d42d576ef90f20563 100644 --- a/src/vs/workbench/api/common/configurationExtensionPoint.ts +++ b/src/vs/workbench/api/common/configurationExtensionPoint.ts @@ -238,6 +238,7 @@ function validateProperties(configuration: IConfigurationNode, extension: IExten const jsonRegistry = Registry.as(JSONExtensions.JSONContribution); jsonRegistry.registerSchema('vscode://schemas/workspaceConfig', { allowComments: true, + allowsTrailingCommas: true, default: { folders: [ { diff --git a/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.ts b/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.ts index 59060ed7fb4d2bf7a9804f787fd66a20efff72dd..82ba354f54a6110109fd4ba08b47ccb9e9a9ae79 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.ts @@ -358,6 +358,7 @@ export class LanguageConfigurationFileHandler { const schemaId = 'vscode://schemas/language-configuration'; const schema: IJSONSchema = { allowComments: true, + allowsTrailingCommas: true, default: { comments: { blockComment: ['/*', '*/'], diff --git a/src/vs/workbench/contrib/debug/common/debugSchemas.ts b/src/vs/workbench/contrib/debug/common/debugSchemas.ts index 6eaa73a28385bc354574c5c1909d45d75ea4f69c..24ecc5d58e716671acea41658f7b268f7a457614 100644 --- a/src/vs/workbench/contrib/debug/common/debugSchemas.ts +++ b/src/vs/workbench/contrib/debug/common/debugSchemas.ts @@ -137,6 +137,8 @@ export const launchSchema: IJSONSchema = { id: launchSchemaId, type: 'object', title: nls.localize('app.launch.json.title', "Launch"), + allowsTrailingCommas: true, + allowComments: true, required: [], default: { version: '0.2.0', configurations: [], compounds: [] }, properties: { diff --git a/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.ts b/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.ts index 7f719e46e5f7722d86836b6921103f779a20ac0a..285e9e48de854d0df55da9070169a2026d3578f7 100644 --- a/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.ts +++ b/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.ts @@ -11,6 +11,7 @@ export const ExtensionsConfigurationSchemaId = 'vscode://schemas/extensions'; export const ExtensionsConfigurationSchema: IJSONSchema = { id: ExtensionsConfigurationSchemaId, allowComments: true, + allowsTrailingCommas: true, type: 'object', title: localize('app.extensions.json.title', "Extensions"), additionalProperties: false, @@ -50,4 +51,4 @@ export const ExtensionsConfigurationInitialContent: string = [ '\t\t', '\t]', '}' -].join('\n'); \ No newline at end of file +].join('\n'); diff --git a/src/vs/workbench/contrib/localizations/browser/localizations.contribution.ts b/src/vs/workbench/contrib/localizations/browser/localizations.contribution.ts index 1982d8aebc02520a79ca5f1ecdeced8ac4943785..6d1f83760144beb66585fb7ed5a5fc3c07ee2ce6 100644 --- a/src/vs/workbench/contrib/localizations/browser/localizations.contribution.ts +++ b/src/vs/workbench/contrib/localizations/browser/localizations.contribution.ts @@ -232,6 +232,7 @@ function registerLocaleDefinitionSchema(languages: string[]): void { jsonRegistry.registerSchema(localeDefinitionFileSchemaId, { id: localeDefinitionFileSchemaId, allowComments: true, + allowsTrailingCommas: true, description: 'Locale Definition file', type: 'object', default: { diff --git a/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts b/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts index ee158fb00bfb6eceb8e350b9282e878da1811e01..c0f886054d51e19ee5ba9e99bc6bd34e4b3c379e 100644 --- a/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts +++ b/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts @@ -28,6 +28,7 @@ const languageScopeSchemaId = 'vscode://schemas/snippets'; const languageScopeSchema: IJSONSchema = { id: languageScopeSchemaId, allowComments: true, + allowsTrailingCommas: true, defaultSnippets: [{ label: nls.localize('snippetSchema.json.default', "Empty snippet"), body: { '${1:snippetName}': { 'prefix': '${2:prefix}', 'body': '${3:snippet}', 'description': '${4:description}' } } @@ -63,6 +64,7 @@ const globalSchemaId = 'vscode://schemas/global-snippets'; const globalSchema: IJSONSchema = { id: globalSchemaId, allowComments: true, + allowsTrailingCommas: true, defaultSnippets: [{ label: nls.localize('snippetSchema.json.default', "Empty snippet"), body: { '${1:snippetName}': { 'scope': '${2:scope}', 'prefix': '${3:prefix}', 'body': '${4:snippet}', 'description': '${5:description}' } } diff --git a/src/vs/workbench/contrib/tasks/browser/task.contribution.ts b/src/vs/workbench/contrib/tasks/browser/task.contribution.ts index 92d2f493108c94874e707a3bfc3275e20cee7f7a..d1af7064a55455e8cdba0a43e3aa2a0606482d64 100644 --- a/src/vs/workbench/contrib/tasks/browser/task.contribution.ts +++ b/src/vs/workbench/contrib/tasks/browser/task.contribution.ts @@ -260,6 +260,8 @@ let schema: IJSONSchema = { id: schemaId, description: 'Task definition file', type: 'object', + allowsTrailingCommas: true, + allowComments: true, default: { version: '2.0.0', tasks: [ diff --git a/src/vs/workbench/services/configuration/browser/configurationService.ts b/src/vs/workbench/services/configuration/browser/configurationService.ts index afa3956cede99010f15ebcd9655ec9e1aed5531d..6c51f691b9ef48ba9526c173af20d338bfa6ad3f 100644 --- a/src/vs/workbench/services/configuration/browser/configurationService.ts +++ b/src/vs/workbench/services/configuration/browser/configurationService.ts @@ -507,17 +507,17 @@ export class WorkspaceService extends Disposable implements IConfigurationServic private registerConfigurationSchemas(): void { if (this.workspace) { const jsonRegistry = Registry.as(JSONExtensions.JSONContribution); - const allSettingsSchema: IJSONSchema = { properties: allSettings.properties, patternProperties: allSettings.patternProperties, additionalProperties: true }; - const userSettingsSchema: IJSONSchema = this.remoteUserConfiguration ? { properties: { ...applicationSettings.properties, ...windowSettings.properties, ...resourceSettings.properties }, patternProperties: allSettings.patternProperties, additionalProperties: true } : allSettingsSchema; - const machineSettingsSchema: IJSONSchema = { properties: { ...machineSettings.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 }; + 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, allowsTrailingCommas: true, allowComments: true } : allSettingsSchema; + 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, allowsTrailingCommas: true, allowComments: true }; jsonRegistry.registerSchema(defaultSettingsSchemaId, allSettingsSchema); jsonRegistry.registerSchema(userSettingsSchemaId, userSettingsSchema); jsonRegistry.registerSchema(machineSettingsSchemaId, machineSettingsSchema); 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(folderSettingsSchemaId, folderSettingsSchema); } else { diff --git a/src/vs/workbench/services/keybinding/browser/keybindingService.ts b/src/vs/workbench/services/keybinding/browser/keybindingService.ts index 8fe901128a923f4c1d45676426b4975c7fc6f27a..4b96b2cd946087e6655493a026499cb34ed4593d 100644 --- a/src/vs/workbench/services/keybinding/browser/keybindingService.ts +++ b/src/vs/workbench/services/keybinding/browser/keybindingService.ts @@ -602,10 +602,12 @@ let commandsSchemas: IJSONSchema[] = []; let commandsEnum: string[] = []; let commandsEnumDescriptions: (string | undefined)[] = []; let schema: IJSONSchema = { - 'id': schemaId, - 'type': 'array', - 'title': nls.localize('keybindings.json.title', "Keybindings configuration"), - 'definitions': { + id: schemaId, + type: 'array', + title: nls.localize('keybindings.json.title', "Keybindings configuration"), + allowsTrailingCommas: true, + allowComments: true, + definitions: { 'editorGroupsSchema': { 'type': 'array', 'items': { @@ -623,7 +625,7 @@ let schema: IJSONSchema = { } } }, - 'items': { + items: { 'required': ['key'], 'type': 'object', 'defaultSnippets': [{ 'body': { 'key': '$1', 'command': '$2', 'when': '$3' } }], diff --git a/src/vs/workbench/services/themes/common/colorThemeSchema.ts b/src/vs/workbench/services/themes/common/colorThemeSchema.ts index 15dd9ab3630d9c4117b8e418d79a9e4bdc12cd1f..08f888a45627666c6c42fc282e79e920065fb30a 100644 --- a/src/vs/workbench/services/themes/common/colorThemeSchema.ts +++ b/src/vs/workbench/services/themes/common/colorThemeSchema.ts @@ -192,6 +192,7 @@ export const colorThemeSchemaId = 'vscode://schemas/color-theme'; const colorThemeSchema: IJSONSchema = { type: 'object', allowComments: true, + allowsTrailingCommas: true, properties: { colors: { description: nls.localize('schema.workbenchColors', 'Colors in the workbench'), diff --git a/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts b/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts index 8327900663dabfa1f55a4394ab1f10fe98cdf094..62257af08dd04f64ee909d1cb124be43e999194a 100644 --- a/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts +++ b/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts @@ -12,6 +12,7 @@ const schemaId = 'vscode://schemas/icon-theme'; const schema: IJSONSchema = { type: 'object', allowComments: true, + allowsTrailingCommas: true, definitions: { folderExpanded: { type: 'string', @@ -221,4 +222,4 @@ const schema: IJSONSchema = { export function registerFileIconThemeSchemas() { let schemaRegistry = Registry.as(JSONExtensions.JSONContribution); schemaRegistry.registerSchema(schemaId, schema); -} \ No newline at end of file +}