From 0d9aa129b08b19a3ed474bc4850b91e382cbf889 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 28 Nov 2017 09:54:51 +0100 Subject: [PATCH] More jsonc adoptions --- extensions/json/package.json | 8 +++++--- src/vs/workbench/electron-browser/main.contribution.ts | 1 + .../languageConfigurationExtensionPoint.ts | 1 + .../parts/extensions/common/extensionsFileTemplate.ts | 1 + .../configuration/common/configurationExtensionPoint.ts | 1 + .../workbench/services/themes/common/colorThemeSchema.ts | 1 + .../services/themes/common/fileIconThemeSchema.ts | 1 + 7 files changed, 11 insertions(+), 3 deletions(-) diff --git a/extensions/json/package.json b/extensions/json/package.json index 18eaa763cf8..43908f3c681 100644 --- a/extensions/json/package.json +++ b/extensions/json/package.json @@ -32,8 +32,7 @@ ".jscsrc", ".eslintrc", ".babelrc", - ".webmanifest", - ".code-workspace" + ".webmanifest" ], "filenames": [ ".watchmanconfig", @@ -51,7 +50,10 @@ "JSON with comments" ], "extensions": [ - ".code-workspace" + ".code-workspace", + "language-configuration.json", + "icon-theme.json", + "color-theme.json" ], "filenames": [ "settings.json", diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts index 1fe4f80c911..bb93b5260fb 100644 --- a/src/vs/workbench/electron-browser/main.contribution.ts +++ b/src/vs/workbench/electron-browser/main.contribution.ts @@ -448,6 +448,7 @@ const schemaId = 'vscode://schemas/locale'; const schema: IJSONSchema = { id: schemaId, + allowComments: true, description: 'Locale Definition file', type: 'object', default: { diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts b/src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts index 4b7695b68b9..b28acd01d56 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts @@ -344,6 +344,7 @@ export class LanguageConfigurationFileHandler { const schemaId = 'vscode://schemas/language-configuration'; const schema: IJSONSchema = { + allowComments: true, default: { comments: { blockComment: ['/*', '*/'], diff --git a/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.ts b/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.ts index 0cb5367299e..fc81cb063d1 100644 --- a/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.ts +++ b/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.ts @@ -10,6 +10,7 @@ import { EXTENSION_IDENTIFIER_PATTERN } from 'vs/platform/extensionManagement/co export const ExtensionsConfigurationSchemaId = 'vscode://schemas/extensions'; export const ExtensionsConfigurationSchema: IJSONSchema = { id: ExtensionsConfigurationSchemaId, + allowComments: true, type: 'object', title: localize('app.extensions.json.title', "Extensions"), properties: { diff --git a/src/vs/workbench/services/configuration/common/configurationExtensionPoint.ts b/src/vs/workbench/services/configuration/common/configurationExtensionPoint.ts index bc35c4cffb1..bdd9c346c22 100644 --- a/src/vs/workbench/services/configuration/common/configurationExtensionPoint.ts +++ b/src/vs/workbench/services/configuration/common/configurationExtensionPoint.ts @@ -149,6 +149,7 @@ function validateProperties(configuration: IConfigurationNode, extension: IExten const jsonRegistry = Registry.as(JSONExtensions.JSONContribution); jsonRegistry.registerSchema('vscode://schemas/workspaceConfig', { + allowComments: true, default: { folders: [ { diff --git a/src/vs/workbench/services/themes/common/colorThemeSchema.ts b/src/vs/workbench/services/themes/common/colorThemeSchema.ts index 4e7c779283c..bfaae07ad34 100644 --- a/src/vs/workbench/services/themes/common/colorThemeSchema.ts +++ b/src/vs/workbench/services/themes/common/colorThemeSchema.ts @@ -184,6 +184,7 @@ export function tokenColorsSchema(description: string): IJSONSchema { const schemaId = 'vscode://schemas/color-theme'; const schema: IJSONSchema = { type: 'object', + allowComments: true, properties: { colors: colorsSchema, tokenColors: { diff --git a/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts b/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts index b26a44c5ab7..e9133b81d4a 100644 --- a/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts +++ b/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts @@ -11,6 +11,7 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema'; const schemaId = 'vscode://schemas/icon-theme'; const schema: IJSONSchema = { type: 'object', + allowComments: true, definitions: { folderExpanded: { type: 'string', -- GitLab