From ebc30748223067bec60b7bac0c3becff77d27e77 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 21 Jul 2016 16:58:59 +0200 Subject: [PATCH 1/9] Emulate LanguageConfiguration.__electricCharacterSupport.docComment with autoClosingPairs --- extensions/typescript/src/typescriptMain.ts | 7 +- src/vs/editor/common/modes.ts | 1 + .../modes/languageConfigurationRegistry.ts | 5 +- .../modes/supports/electricCharacter.ts | 79 +++++++++++-------- .../test/common/modes/autoIndentation.test.ts | 3 +- 5 files changed, 52 insertions(+), 43 deletions(-) diff --git a/extensions/typescript/src/typescriptMain.ts b/extensions/typescript/src/typescriptMain.ts index 197559ac318..ee4650a1937 100644 --- a/extensions/typescript/src/typescriptMain.ts +++ b/extensions/typescript/src/typescriptMain.ts @@ -206,18 +206,17 @@ class LanguageProvider { } ], - __electricCharacterSupport: { - docComment: { scope: 'comment.documentation', open: '/**', lineStart: ' * ', close: ' */' } - }, __characterPairSupport: { autoClosingPairs: [ { open: '{', close: '}' }, { open: '[', close: ']' }, { open: '(', close: ')' }, + { open: '"', close: '"', notIn: ['string'] }, { open: '\'', close: '\'', notIn: ['string', 'comment'] }, - { open: '`', close: '`', notIn: ['string', 'comment'] } + { open: '`', close: '`', notIn: ['string', 'comment'] }, + { open: '/**', close: ' */', notIn: ['string'] } ] } }); diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index 983de4140f6..f9c4d597513 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -879,6 +879,7 @@ export type CharacterPair = [string, string]; export interface IAutoClosingPairConditional extends IAutoClosingPair { notIn?: string[]; + } /** diff --git a/src/vs/editor/common/modes/languageConfigurationRegistry.ts b/src/vs/editor/common/modes/languageConfigurationRegistry.ts index d7a6f25b7f8..c6f97107780 100644 --- a/src/vs/editor/common/modes/languageConfigurationRegistry.ts +++ b/src/vs/editor/common/modes/languageConfigurationRegistry.ts @@ -111,10 +111,7 @@ export class RichEditSupport { this._handleComments(modeId, this._conf); this.characterPair = new CharacterPairSupport(LanguageConfigurationRegistry, modeId, this._conf); - - if (this._conf.__electricCharacterSupport || this._conf.brackets) { - this.electricCharacter = new BracketElectricCharacterSupport(LanguageConfigurationRegistry, modeId, this.brackets, this._conf.__electricCharacterSupport); - } + this.electricCharacter = new BracketElectricCharacterSupport(LanguageConfigurationRegistry, modeId, this.brackets, this.characterPair.getAutoClosingPairs(), this._conf.__electricCharacterSupport); this.wordDefinition = this._conf.wordPattern || DEFAULT_WORD_REGEXP; } diff --git a/src/vs/editor/common/modes/supports/electricCharacter.ts b/src/vs/editor/common/modes/supports/electricCharacter.ts index 0cc1f70a177..6dbc1f312c3 100644 --- a/src/vs/editor/common/modes/supports/electricCharacter.ts +++ b/src/vs/editor/common/modes/supports/electricCharacter.ts @@ -32,11 +32,11 @@ export class BracketElectricCharacterSupport implements modes.IRichEditElectricC private contribution: IBracketElectricCharacterContribution; private brackets: Brackets; - constructor(registry:LanguageConfigurationRegistryImpl, modeId: string, brackets: modes.IRichEditBrackets, contribution: IBracketElectricCharacterContribution) { + constructor(registry:LanguageConfigurationRegistryImpl, modeId: string, brackets: modes.IRichEditBrackets, autoClosePairs: modes.IAutoClosingPairConditional[], contribution: IBracketElectricCharacterContribution) { this._registry = registry; this._modeId = modeId; this.contribution = contribution || {}; - this.brackets = new Brackets(modeId, brackets, this.contribution.docComment); + this.brackets = new Brackets(modeId, brackets, autoClosePairs, contribution.docComment); } public getElectricCharacters(): string[]{ @@ -66,12 +66,16 @@ export class Brackets { private _modeId: string; private _richEditBrackets: modes.IRichEditBrackets; - private _docComment: IDocComment; + private _complexAutoClosePairs: modes.IAutoClosingPairConditional[]; - constructor(modeId: string, richEditBrackets: modes.IRichEditBrackets, docComment: IDocComment = null) { + constructor(modeId: string, richEditBrackets: modes.IRichEditBrackets, autoClosePairs: modes.IAutoClosingPairConditional[], docComment?: IDocComment) { this._modeId = modeId; this._richEditBrackets = richEditBrackets; - this._docComment = docComment ? docComment : null; + this._complexAutoClosePairs = autoClosePairs.filter(pair => pair.open.length > 1 && !!pair.close); + if (docComment) { + // IDocComment is legacy, only partially supported + this._complexAutoClosePairs.push({ open:docComment.open, close: docComment.close }); + } } public getElectricCharacters():string[] { @@ -85,9 +89,9 @@ export class Brackets { } } - // Doc comments - if (this._docComment){ - result.push(this._docComment.open.charAt(this._docComment.open.length - 1)); + // auto close + for (let pair of this._complexAutoClosePairs) { + result.push(pair.open.charAt(pair.open.length - 1)); } // Filter duplicate entries @@ -103,8 +107,8 @@ export class Brackets { return null; } - return (this._onElectricCharacterDocComment(context, offset) || - this._onElectricCharacterStandardBrackets(context, offset)); + return (this._onElectricAutoClose(context, offset) || + this._onElectricAutoIndent(context, offset)); } private containsTokenTypes(fullTokenSpec: string, tokensToLookFor: string): boolean { @@ -117,7 +121,7 @@ export class Brackets { return true; } - private _onElectricCharacterStandardBrackets(context: modes.ILineContext, offset: number): modes.IElectricAction { + private _onElectricAutoIndent(context: modes.ILineContext, offset: number): modes.IElectricAction { if (!this._richEditBrackets || this._richEditBrackets.brackets.length === 0) { return null; @@ -151,35 +155,44 @@ export class Brackets { return null; } - private _onElectricCharacterDocComment(context: modes.ILineContext, offset: number): modes.IElectricAction { - // We only auto-close, so do nothing if there is no closing part. - if (!this._docComment || !this._docComment.close) { + private _onElectricAutoClose(context: modes.ILineContext, offset: number): modes.IElectricAction { + + if (!this._complexAutoClosePairs.length) { return null; } var line = context.getLineContent(); var char: string = line[offset]; - // See if the right electric character was pressed - if (char !== this._docComment.open.charAt(this._docComment.open.length - 1)) { - return null; + for (let i = 0; i < this._complexAutoClosePairs.length; i++) { + let pair = this._complexAutoClosePairs[i]; + + // See if the right electric character was pressed + if (char !== pair.open.charAt(pair.open.length - 1)) { + continue; + } + + // If this line already contains the closing tag, do nothing. + if (line.indexOf(pair.close, offset) >= 0) { + continue; + } + + // check if the full open bracket matches + let lastTokenIndex = context.findIndexOfOffset(offset); + if (line.substring(context.getTokenStartIndex(lastTokenIndex), offset+1/* include electric char*/) !== pair.open) { + continue; + } + + // If we're in a scope listen in 'notIn', do nothing + if (pair.notIn) { + let tokenType = context.getTokenType(lastTokenIndex); + if (pair.notIn.some(scope => this.containsTokenTypes(tokenType, scope))) { + continue; + } + } + + return { appendText: pair.close}; } - // If this line already contains the closing tag, do nothing. - if (line.indexOf(this._docComment.close, offset) >= 0) { - return null; - } - - // If we're not in a documentation comment, do nothing. - var lastTokenIndex = context.findIndexOfOffset(offset); - if (! this.containsTokenTypes(context.getTokenType(lastTokenIndex), this._docComment.scope)) { - return null; - } - - if (line.substring(context.getTokenStartIndex(lastTokenIndex), offset+1/* include electric char*/) !== this._docComment.open) { - return null; - } - - return { appendText: this._docComment.close}; } } diff --git a/src/vs/editor/test/common/modes/autoIndentation.test.ts b/src/vs/editor/test/common/modes/autoIndentation.test.ts index c2afe34f4e2..1663dd2f6c2 100644 --- a/src/vs/editor/test/common/modes/autoIndentation.test.ts +++ b/src/vs/editor/test/common/modes/autoIndentation.test.ts @@ -10,8 +10,7 @@ import {createLineContextFromTokenText} from 'vs/editor/test/common/modesTestUti suite('Editor Modes - Auto Indentation', () => { test('Doc comments', () => { - var brackets = new Brackets('test', null, - { scope: 'doc', open: '/**', lineStart: ' * ', close: ' */' }); + var brackets = new Brackets('test', null, [{ open: '/**', close: ' */' }]); assert.equal(brackets.onElectricCharacter(createLineContextFromTokenText([ { text: '/**', type: 'doc' }, From f4a8c7a5e12e0ec2869fb7d77b3c75878342d9b1 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 21 Jul 2016 18:17:33 +0200 Subject: [PATCH 2/9] More comments on deprecated LanguageConfiguration settings --- src/vs/vscode.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 96f58bb3a07..87638a0080d 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -2459,6 +2459,12 @@ declare namespace vscode { * @deprecated */ brackets?: any; + /** + * This property is deprecated and not fully supported anymore by + * the editor (scope and lineStart are ignored). + * Use the the autoClosingPairs property in the language configuration file instead. + * @deprecated + */ docComment?: { scope: string; open: string; @@ -2470,7 +2476,7 @@ declare namespace vscode { /** * **Deprecated** Do not use. * - * @deprecated Use the language configuration file instead. + * @deprecated * Use the the autoClosingPairs property in the language configuration file instead. */ __characterPairSupport?: { autoClosingPairs: { From edecd8bc74408d82b96c5d8b7750480bdb163379 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 21 Jul 2016 18:52:34 +0200 Subject: [PATCH 3/9] Adopt css to language-configuration --- extensions/css/client/src/cssMain.ts | 49 ++------------------- extensions/css/language-configuration.json | 24 ++++++++++ extensions/css/package.json | 3 +- extensions/less/language-configuration.json | 27 ++++++++++++ extensions/less/package.json | 3 +- extensions/scss/language-configuration.json | 27 ++++++++++++ extensions/scss/package.json | 3 +- src/vs/editor/node/languageConfiguration.ts | 14 +++--- 8 files changed, 95 insertions(+), 55 deletions(-) create mode 100644 extensions/css/language-configuration.json create mode 100644 extensions/less/language-configuration.json create mode 100644 extensions/scss/language-configuration.json diff --git a/extensions/css/client/src/cssMain.ts b/extensions/css/client/src/cssMain.ts index 9c932a2d927..bf5d06089b1 100644 --- a/extensions/css/client/src/cssMain.ts +++ b/extensions/css/client/src/cssMain.ts @@ -54,58 +54,15 @@ export function activate(context: ExtensionContext) { context.subscriptions.push(disposable); languages.setLanguageConfiguration('css', { - wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\w-?]+%?|[@#!.])/g, - comments: { - blockComment: ['/*', '*/'] - }, - brackets: [['{', '}'], ['[', ']'], ['(', ')']], - __characterPairSupport: { - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"', notIn: ['string'] }, - { open: '\'', close: '\'', notIn: ['string'] } - ] - } + wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\w-?]+%?|[@#!.])/g }); languages.setLanguageConfiguration('less', { - wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]+(?=[^,{;]*[,{]))|(([@#.!])?[\w-?]+%?|[@#!.])/g, - comments: { - blockComment: ['/*', '*/'], - lineComment: '//' - }, - brackets: [['{', '}'], ['[', ']'], ['(', ')'], ['<', '>']], - __characterPairSupport: { - autoClosingPairs: [ - { open: '"', close: '"', notIn: ['string', 'comment'] }, - { open: '\'', close: '\'', notIn: ['string', 'comment'] }, - { open: '{', close: '}', notIn: ['string', 'comment'] }, - { open: '[', close: ']', notIn: ['string', 'comment'] }, - { open: '(', close: ')', notIn: ['string', 'comment'] }, - { open: '<', close: '>', notIn: ['string', 'comment'] }, - ] - } + wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]+(?=[^,{;]*[,{]))|(([@#.!])?[\w-?]+%?|[@#!.])/g }); languages.setLanguageConfiguration('scss', { - wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]*(?=[^,{;]*[,{]))|(([@$#.!])?[\w-?]+%?|[@#!$.])/g, - comments: { - blockComment: ['/*', '*/'], - lineComment: '//' - }, - brackets: [['{', '}'], ['[', ']'], ['(', ')'], ['<', '>']], - __characterPairSupport: { - autoClosingPairs: [ - { open: '"', close: '"', notIn: ['string', 'comment'] }, - { open: '\'', close: '\'', notIn: ['string', 'comment'] }, - { open: '{', close: '}', notIn: ['string', 'comment'] }, - { open: '[', close: ']', notIn: ['string', 'comment'] }, - { open: '(', close: ')', notIn: ['string', 'comment'] }, - { open: '<', close: '>', notIn: ['string', 'comment'] }, - ] - } + wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]*(?=[^,{;]*[,{]))|(([@$#.!])?[\w-?]+%?|[@#!$.])/g }); commands.registerCommand('_css.applyCodeAction', applyCodeAction); diff --git a/extensions/css/language-configuration.json b/extensions/css/language-configuration.json new file mode 100644 index 00000000000..ae86befcd2a --- /dev/null +++ b/extensions/css/language-configuration.json @@ -0,0 +1,24 @@ +{ + "comments": { + "blockComment": ["/*", "*/"] + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}", "notIn": ["string", "comment"] }, + { "open": "[", "close": "]", "notIn": ["string", "comment"] }, + { "open": "(", "close": ")", "notIn": ["string", "comment"] }, + { "open": "\"", "close": "\"", "notIn": ["string", "comment"] }, + { "open": "'", "close": "'", "notIn": ["string", "comment"] } + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/extensions/css/package.json b/extensions/css/package.json index 56058f2bde8..b9c09564918 100644 --- a/extensions/css/package.json +++ b/extensions/css/package.json @@ -21,7 +21,8 @@ "id": "css", "aliases": ["CSS", "css"], "extensions": [".css"], - "mimetypes": ["text/css"] + "mimetypes": ["text/css"], + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "css", diff --git a/extensions/less/language-configuration.json b/extensions/less/language-configuration.json new file mode 100644 index 00000000000..570a46c4c9e --- /dev/null +++ b/extensions/less/language-configuration.json @@ -0,0 +1,27 @@ +{ + "comments": { + "blockComment": ["/*", "*/"], + "lineComment": "//" + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["<", ">"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}", "notIn": ["string", "comment"] }, + { "open": "[", "close": "]", "notIn": ["string", "comment"] }, + { "open": "(", "close": ")", "notIn": ["string", "comment"] }, + { "open": "\"", "close": "\"", "notIn": ["string", "comment"] }, + { "open": "'", "close": "'", "notIn": ["string", "comment"] } + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"], + ["<", ">"] + ] +} \ No newline at end of file diff --git a/extensions/less/package.json b/extensions/less/package.json index 96142a610ff..e6b9fd6368e 100644 --- a/extensions/less/package.json +++ b/extensions/less/package.json @@ -8,7 +8,8 @@ "id": "less", "aliases": ["Less", "less"], "extensions": [".less"], - "mimetypes": ["text/x-less", "text/less"] + "mimetypes": ["text/x-less", "text/less"], + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "less", diff --git a/extensions/scss/language-configuration.json b/extensions/scss/language-configuration.json new file mode 100644 index 00000000000..570a46c4c9e --- /dev/null +++ b/extensions/scss/language-configuration.json @@ -0,0 +1,27 @@ +{ + "comments": { + "blockComment": ["/*", "*/"], + "lineComment": "//" + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["<", ">"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}", "notIn": ["string", "comment"] }, + { "open": "[", "close": "]", "notIn": ["string", "comment"] }, + { "open": "(", "close": ")", "notIn": ["string", "comment"] }, + { "open": "\"", "close": "\"", "notIn": ["string", "comment"] }, + { "open": "'", "close": "'", "notIn": ["string", "comment"] } + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"], + ["<", ">"] + ] +} \ No newline at end of file diff --git a/extensions/scss/package.json b/extensions/scss/package.json index 1a3ba922e02..1f1cb3bc7d7 100644 --- a/extensions/scss/package.json +++ b/extensions/scss/package.json @@ -8,7 +8,8 @@ "id": "scss", "aliases": ["Sass", "scss"], "extensions": [".scss"], - "mimetypes": ["text/x-scss", "text/scss"] + "mimetypes": ["text/x-scss", "text/scss"], + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "scss", diff --git a/src/vs/editor/node/languageConfiguration.ts b/src/vs/editor/node/languageConfiguration.ts index 978827da063..8b0b55712fe 100644 --- a/src/vs/editor/node/languageConfiguration.ts +++ b/src/vs/editor/node/languageConfiguration.ts @@ -9,7 +9,7 @@ import {parse} from 'vs/base/common/json'; import {readFile} from 'vs/base/node/pfs'; import {LanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry'; import {IModeService} from 'vs/editor/common/services/modeService'; -import {IAutoClosingPair} from 'vs/editor/common/modes'; +import {IAutoClosingPair, IAutoClosingPairConditional} from 'vs/editor/common/modes'; import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry'; type CharacterPair = [string, string]; @@ -22,8 +22,8 @@ interface ICommentRule { interface ILanguageConfiguration { comments?: ICommentRule; brackets?: CharacterPair[]; - autoClosingPairs?: CharacterPair[]; - surroundingPairs?: CharacterPair[]; + autoClosingPairs?: (CharacterPair | IAutoClosingPairConditional)[]; + surroundingPairs?: (CharacterPair | IAutoClosingPair)[]; } export class LanguageConfigurationFileHandler { @@ -92,10 +92,12 @@ export class LanguageConfigurationFileHandler { LanguageConfigurationRegistry.register(modeId, richEditConfig); } - private _mapCharacterPairs(pairs:CharacterPair[]): IAutoClosingPair[] { + private _mapCharacterPairs(pairs: (CharacterPair | IAutoClosingPairConditional)[]): IAutoClosingPairConditional[] { return pairs.map(pair => { - let [open, close] = pair; - return { open: open, close: close }; + if (Array.isArray(pair)) { + return { open: pair[0], close: pair[1] }; + } + return pair; }); } } From 710824bcb38378d9cafc9965b7f6b29fcf959b80 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 21 Jul 2016 19:48:06 +0200 Subject: [PATCH 4/9] fix NPE accessing docElement --- src/vs/editor/common/modes/supports/electricCharacter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/common/modes/supports/electricCharacter.ts b/src/vs/editor/common/modes/supports/electricCharacter.ts index 6dbc1f312c3..1f9dadfb2cb 100644 --- a/src/vs/editor/common/modes/supports/electricCharacter.ts +++ b/src/vs/editor/common/modes/supports/electricCharacter.ts @@ -36,7 +36,7 @@ export class BracketElectricCharacterSupport implements modes.IRichEditElectricC this._registry = registry; this._modeId = modeId; this.contribution = contribution || {}; - this.brackets = new Brackets(modeId, brackets, autoClosePairs, contribution.docComment); + this.brackets = new Brackets(modeId, brackets, autoClosePairs, this.contribution.docComment); } public getElectricCharacters(): string[]{ @@ -74,7 +74,7 @@ export class Brackets { this._complexAutoClosePairs = autoClosePairs.filter(pair => pair.open.length > 1 && !!pair.close); if (docComment) { // IDocComment is legacy, only partially supported - this._complexAutoClosePairs.push({ open:docComment.open, close: docComment.close }); + this._complexAutoClosePairs.push({ open: docComment.open, close: docComment.close }); } } From c04f01e60cbfe17797a8660a94254b00acb26e35 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 21 Jul 2016 19:49:43 +0200 Subject: [PATCH 5/9] Add schema for language-configuration.json --- extensions/json/package.json | 4 + src/vs/editor/node/languageConfiguration.ts | 126 ++++++++++++++++++++ 2 files changed, 130 insertions(+) diff --git a/extensions/json/package.json b/extensions/json/package.json index cd9a9c908f1..4cb0227ae7b 100644 --- a/extensions/json/package.json +++ b/extensions/json/package.json @@ -54,6 +54,10 @@ "fileMatch": "package.json", "url": "vscode://schemas/vscode-extensions" }, + { + "fileMatch": "language-configuration.json", + "url": "vscode://schemas/language-configuration" + }, { "fileMatch": "vscode://defaultsettings/keybindings.json", "url": "vscode://schemas/keybindings" diff --git a/src/vs/editor/node/languageConfiguration.ts b/src/vs/editor/node/languageConfiguration.ts index 8b0b55712fe..12c8edab83c 100644 --- a/src/vs/editor/node/languageConfiguration.ts +++ b/src/vs/editor/node/languageConfiguration.ts @@ -11,6 +11,9 @@ import {LanguageConfiguration} from 'vs/editor/common/modes/languageConfiguratio import {IModeService} from 'vs/editor/common/services/modeService'; import {IAutoClosingPair, IAutoClosingPairConditional} from 'vs/editor/common/modes'; import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry'; +import {Extensions, IJSONContributionRegistry} from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; +import {Registry} from 'vs/platform/platform'; +import {IJSONSchema} from 'vs/base/common/jsonSchema'; type CharacterPair = [string, string]; @@ -101,3 +104,126 @@ export class LanguageConfigurationFileHandler { }); } } + +const schemaId = 'vscode://schemas/language-configuration'; +const schema: IJSONSchema = { + default: { + comments: { + blockComment: ['/*', '*/'], + lineComment: '//' + }, + brackets: [ [ '(', ')' ], [ '[', ']' ] , [ '{', '}' ]], + autoClosingPairs: [ [ '(', ')' ], [ '[', ']' ] , [ '{', '}' ]], + surroundingPairs: [ [ '(', ')' ], [ '[', ']' ] , [ '{', '}' ]] + }, + definitions: { + openBracket: { + type: 'string', + description: nls.localize('schema.openBracket', 'The opening bracket character or string sequence.') + }, + closeBracket: { + type: 'string', + description: nls.localize('schema.closeBracket', 'The closing bracket character or string sequence.') + }, + bracketPair: { + type: 'array', + items: [{ + $ref: '#definitions/openBracket' + },{ + $ref: '#definitions/closeBracket' + }] + } + }, + properties: { + comments: { + default: { + comments: { + blockComment: ['/*', '*/'], + lineComment: '//' + } + }, + description: nls.localize('schema.comments', 'Defines the comment symbols'), + type: 'object', + properties: { + blockComment: { + type: 'array', + description: nls.localize('schema.blockComments', 'Defines how block comments are marked.'), + items: [{ + type: 'string', + description: nls.localize('schema.blockComment.begin', 'The character sequence that starts a block comment.') + },{ + type: 'string', + description: nls.localize('schema.blockComment.end', 'The character sequence that ends a block comment.') + }] + }, + lineComment: { + type: 'string', + description: nls.localize('schema.lineComment', 'The character sequence that starts a line comment.') + } + } + }, + brackets: { + default: { + brackets: [ [ '(', ')' ], [ '[', ']' ] , [ '{', '}' ]] + }, + description: nls.localize('schema.brackets', 'Defines the bracket symbols that increase or decrease the indentation.'), + type: 'array', + items: { + $ref: '#definitions/bracketPair' + } + }, + autoClosingPairs: { + default: { + autoClosingPairs: [ [ '(', ')' ], [ '[', ']' ] , [ '{', '}' ]] + }, + description: nls.localize('schema.autoClosingPairs', 'Defines the bracket pairs. When a opening bracket is entered, the closing bracket is inserted automatically.'), + type: 'array', + items: { + oneOf: [{ + $ref: '#definitions/bracketPair' + },{ + type: 'object', + properties: { + open: { + $ref: '#definitions/openBracket' + }, + close: { + $ref: '#definitions/closeBracket' + }, + notIn: { + type: 'array', + description: nls.localize('schema.autoClosingPairs.notIn', 'Defines a list of scopes where the auto pairs are disabled.'), + items: { + enum: ['string', 'comment'] + } + } + } + }] + } + }, + surroundingPairs: { + default: { + surroundingPairs: [ [ '(', ')' ], [ '[', ']' ] , [ '{', '}' ]] + }, + description: nls.localize('schema.surroundingPairs', 'Defines the bracket pairs that can be used to surround a selected string.'), + type: 'array', + items: { + oneOf: [{ + $ref: '#definitions/bracketPair' + },{ + type: 'object', + properties: { + open: { + $ref: '#definitions/openBracket' + }, + close: { + $ref: '#definitions/closeBracket' + } + } + }] + } + }, + } +}; +let schemaRegistry = Registry.as(Extensions.JSONContribution); +schemaRegistry.registerSchema(schemaId, schema); From e7ae751e50586760c35cb6b9eb4f539f19377c79 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 21 Jul 2016 19:54:03 +0200 Subject: [PATCH 6/9] Migrate JSON to language-configuration --- extensions/json/client/src/jsonMain.ts | 12 +----------- extensions/json/json.configuration.json | 10 ---------- extensions/json/language-configuration.json | 18 ++++++++++++++++++ extensions/json/package.json | 2 +- 4 files changed, 20 insertions(+), 22 deletions(-) delete mode 100644 extensions/json/json.configuration.json create mode 100644 extensions/json/language-configuration.json diff --git a/extensions/json/client/src/jsonMain.ts b/extensions/json/client/src/jsonMain.ts index 458734d6096..ad11e170022 100644 --- a/extensions/json/client/src/jsonMain.ts +++ b/extensions/json/client/src/jsonMain.ts @@ -89,17 +89,7 @@ export function activate(context: ExtensionContext) { context.subscriptions.push(disposable); languages.setLanguageConfiguration('json', { - wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g, - __characterPairSupport: { - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"', notIn: ['string'] }, - { open: '\'', close: '\'', notIn: ['string', 'comment'] }, - { open: '`', close: '`', notIn: ['string', 'comment'] } - ] - } + wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g }); }); } diff --git a/extensions/json/json.configuration.json b/extensions/json/json.configuration.json deleted file mode 100644 index 4c17a67aa09..00000000000 --- a/extensions/json/json.configuration.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "comments": { - "lineComment": "//", - "blockComment": [ "/*", "*/" ] - }, - "brackets": [ - ["{", "}"], - ["[", "]"] - ] -} \ No newline at end of file diff --git a/extensions/json/language-configuration.json b/extensions/json/language-configuration.json new file mode 100644 index 00000000000..53ccbd23546 --- /dev/null +++ b/extensions/json/language-configuration.json @@ -0,0 +1,18 @@ +{ + "comments": { + "lineComment": "//", + "blockComment": [ "/*", "*/" ] + }, + "brackets": [ + ["{", "}"], + ["[", "]"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}", "notIn": ["string"] }, + { "open": "[", "close": "]", "notIn": ["string"] }, + { "open": "(", "close": ")", "notIn": ["string"] }, + { "open": "'", "close": "'", "notIn": ["string"] }, + { "open": "\"", "close": "\"", "notIn": ["string", "comment"] }, + { "open": "`", "close": "`", "notIn": ["string", "comment"] } + ] +} \ No newline at end of file diff --git a/extensions/json/package.json b/extensions/json/package.json index 4cb0227ae7b..5dc106c0022 100644 --- a/extensions/json/package.json +++ b/extensions/json/package.json @@ -35,7 +35,7 @@ "application/json", "application/manifest+json" ], - "configuration": "./json.configuration.json" + "configuration": "./language-configuration.json" } ], "grammars": [ From 354a014029681c92a3886588e7c02b8eb01748b5 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 21 Jul 2016 19:57:02 +0200 Subject: [PATCH 7/9] Migrate PHP to language-configuration --- extensions/php/language-configuration.json | 19 +++++++++++++++++++ extensions/php/package.json | 2 +- extensions/php/php.configuration.json | 12 ------------ extensions/php/src/phpMain.ts | 12 +----------- 4 files changed, 21 insertions(+), 24 deletions(-) create mode 100644 extensions/php/language-configuration.json delete mode 100644 extensions/php/php.configuration.json diff --git a/extensions/php/language-configuration.json b/extensions/php/language-configuration.json new file mode 100644 index 00000000000..52d8bd3401f --- /dev/null +++ b/extensions/php/language-configuration.json @@ -0,0 +1,19 @@ +{ + "comments": { + "lineComment": "//", // "#" + "blockComment": [ "/*", "*/" ] + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}", "notIn": ["string"] }, + { "open": "[", "close": "]", "notIn": ["string"] }, + { "open": "(", "close": ")", "notIn": ["string"] }, + { "open": "'", "close": "'", "notIn": ["string"] }, + { "open": "\"", "close": "\"", "notIn": ["string", "comment"] } + ] + +} \ No newline at end of file diff --git a/extensions/php/package.json b/extensions/php/package.json index 45bcc6afb14..53618fd8657 100644 --- a/extensions/php/package.json +++ b/extensions/php/package.json @@ -14,7 +14,7 @@ "extensions": [ ".php", ".php4", ".php5", ".phtml", ".ctp" ], "aliases": [ "PHP", "php" ], "mimetypes": ["application/x-php"], - "configuration": "./php.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "php", diff --git a/extensions/php/php.configuration.json b/extensions/php/php.configuration.json deleted file mode 100644 index 431ee4bc667..00000000000 --- a/extensions/php/php.configuration.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "comments": { - "lineComment": "//", // "#" - "blockComment": [ "/*", "*/" ] - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ] - -} \ No newline at end of file diff --git a/extensions/php/src/phpMain.ts b/extensions/php/src/phpMain.ts index 56d41d39a44..3cb964d1e02 100644 --- a/extensions/php/src/phpMain.ts +++ b/extensions/php/src/phpMain.ts @@ -26,16 +26,6 @@ export function activate(context: ExtensionContext): any { // need to set in the extension host as well as the completion provider uses it. languages.setLanguageConfiguration('php', { - wordPattern: /(-?\d*\.\d\w*)|([^\-\`\~\!\@\#\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, - - __characterPairSupport: { - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"', notIn: ['string'] }, - { open: '\'', close: '\'', notIn: ['string', 'comment'] } - ] - } + wordPattern: /(-?\d*\.\d\w*)|([^\-\`\~\!\@\#\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g }); } \ No newline at end of file From e929d1d8f05c2b1a618411632a1d958e364a1f1d Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 21 Jul 2016 20:06:20 +0200 Subject: [PATCH 8/9] Migrate JS/TS to language-configuration --- .../javascript/javascript.configuration.json | 11 ------- .../javascript/language-configuration.json | 28 +++++++++++++++++ extensions/javascript/package.json | 5 ++-- .../typescript/language-configuration.json | 30 +++++++++++++++++++ extensions/typescript/package.json | 6 ++-- extensions/typescript/src/typescriptMain.ts | 25 +--------------- 6 files changed, 66 insertions(+), 39 deletions(-) delete mode 100644 extensions/javascript/javascript.configuration.json create mode 100644 extensions/javascript/language-configuration.json create mode 100644 extensions/typescript/language-configuration.json diff --git a/extensions/javascript/javascript.configuration.json b/extensions/javascript/javascript.configuration.json deleted file mode 100644 index da6ed547150..00000000000 --- a/extensions/javascript/javascript.configuration.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "comments": { - "lineComment": "//", - "blockComment": [ "/*", "*/" ] - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ] -} \ No newline at end of file diff --git a/extensions/javascript/language-configuration.json b/extensions/javascript/language-configuration.json new file mode 100644 index 00000000000..7986cfa5711 --- /dev/null +++ b/extensions/javascript/language-configuration.json @@ -0,0 +1,28 @@ +{ + "comments": { + "lineComment": "//", + "blockComment": [ "/*", "*/" ] + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}" }, + { "open": "[", "close": "]" }, + { "open": "(", "close": ")" }, + { "open": "'", "close": "'", "notIn": ["string"] }, + { "open": "\"", "close": "\"", "notIn": ["string", "comment"] }, + { "open": "`", "close": "`", "notIn": ["string", "comment"] }, + { "open": "/**", "close": " */", "notIn": ["string"] } + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["'", "'"], + ["\"", "\""], + ["`", "`"] + ] +} \ No newline at end of file diff --git a/extensions/javascript/package.json b/extensions/javascript/package.json index 63d55f7ed91..e28f71d8387 100644 --- a/extensions/javascript/package.json +++ b/extensions/javascript/package.json @@ -27,7 +27,7 @@ "extensions": [ ".jsx" ], - "configuration": "./javascript.configuration.json" + "configuration": "./language-configuration.json" }, { "id": "javascript", @@ -46,7 +46,8 @@ "firstLine": "^#!.*\\bnode", "mimetypes": [ "text/javascript" - ] + ], + "configuration": "./language-configuration.json" } ], "grammars": [ diff --git a/extensions/typescript/language-configuration.json b/extensions/typescript/language-configuration.json new file mode 100644 index 00000000000..861d3337395 --- /dev/null +++ b/extensions/typescript/language-configuration.json @@ -0,0 +1,30 @@ +{ + "comments": { + "lineComment": "//", + "blockComment": [ "/*", "*/" ] + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["<", ">"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}" }, + { "open": "[", "close": "]" }, + { "open": "(", "close": ")" }, + { "open": "'", "close": "'", "notIn": ["string"] }, + { "open": "\"", "close": "\"", "notIn": ["string", "comment"] }, + { "open": "`", "close": "`", "notIn": ["string", "comment"] }, + { "open": "/**", "close": " */", "notIn": ["string"] } + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["<", ">"], + ["'", "'"], + ["\"", "\""], + ["`", "`"] + ] +} \ No newline at end of file diff --git a/extensions/typescript/package.json b/extensions/typescript/package.json index 62ab4f18ca6..56b3cee4d99 100644 --- a/extensions/typescript/package.json +++ b/extensions/typescript/package.json @@ -37,7 +37,8 @@ ], "extensions": [ ".ts" - ] + ], + "configuration": "./language-configuration.json" }, { "id": "typescriptreact", @@ -47,7 +48,8 @@ ], "extensions": [ ".tsx" - ] + ], + "configuration": "./language-configuration.json" } ], "grammars": [ diff --git a/extensions/typescript/src/typescriptMain.ts b/extensions/typescript/src/typescriptMain.ts index ee4650a1937..3e9cfc44912 100644 --- a/extensions/typescript/src/typescriptMain.ts +++ b/extensions/typescript/src/typescriptMain.ts @@ -168,15 +168,6 @@ class LanguageProvider { increaseIndentPattern: /^.*\{[^}"']*$/ }, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'], - ], onEnterRules: [ { // e.g. /** | */ @@ -204,21 +195,7 @@ class LanguageProvider { beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/, action: { indentAction: IndentAction.None, removeText: 1 } } - ], - - - __characterPairSupport: { - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - - { open: '"', close: '"', notIn: ['string'] }, - { open: '\'', close: '\'', notIn: ['string', 'comment'] }, - { open: '`', close: '`', notIn: ['string', 'comment'] }, - { open: '/**', close: ' */', notIn: ['string'] } - ] - } + ] }); }); } From 4a13944af6872446f83cf7e289696a8d6d859358 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 21 Jul 2016 20:30:37 +0200 Subject: [PATCH 9/9] Migrate all other languages to language-configuration.json --- .../{bat.configuration.json => language-configuration.json} | 0 extensions/bat/package.json | 2 +- ...clojure.configuration.json => language-configuration.json} | 0 extensions/clojure/package.json | 2 +- ...escript.configuration.json => language-configuration.json} | 0 extensions/coffeescript/package.json | 2 +- .../{cpp.configuration.json => language-configuration.json} | 0 extensions/cpp/package.json | 4 ++-- .../{diff.configuration.json => language-configuration.json} | 0 extensions/diff/package.json | 2 +- ...kerfile.configuration.json => language-configuration.json} | 0 extensions/docker/package.json | 2 +- ...{fsharp.configuration.json => language-configuration.json} | 0 extensions/fsharp/package.json | 2 +- ...figuration.json => git-commit.language-configuration.json} | 0 ...figuration.json => git-rebase.language-configuration.json} | 0 extensions/git/package.json | 4 ++-- .../go/{go.configuration.json => language-configuration.json} | 0 extensions/go/package.json | 2 +- ...{groovy.configuration.json => language-configuration.json} | 0 extensions/groovy/package.json | 2 +- .../{ini.configuration.json => language-configuration.json} | 0 extensions/ini/package.json | 2 +- .../{jade.configuration.json => language-configuration.json} | 0 extensions/jade/package.json | 2 +- .../{java.configuration.json => language-configuration.json} | 0 extensions/java/package.json | 2 +- extensions/json/package.json | 2 +- .../{lua.configuration.json => language-configuration.json} | 0 extensions/lua/package.json | 2 +- .../{make.configuration.json => language-configuration.json} | 0 extensions/make/package.json | 2 +- ...arkdown.configuration.json => language-configuration.json} | 0 extensions/markdown/package.json | 2 +- ...ctive-c.configuration.json => language-configuration.json} | 0 extensions/objective-c/package.json | 2 +- extensions/perl/package.json | 4 ++-- ...rl.configuration.json => perl.language-configuration.json} | 0 ...6.configuration.json => perl6.language-configuration.json} | 0 ...ershell.configuration.json => language-configuration.json} | 0 extensions/powershell/package.json | 2 +- ...{python.configuration.json => language-configuration.json} | 0 extensions/python/package.json | 2 +- .../r/{r.configuration.json => language-configuration.json} | 0 extensions/r/package.json | 2 +- .../{ruby.configuration.json => language-configuration.json} | 0 extensions/ruby/package.json | 2 +- .../{rust.configuration.json => language-configuration.json} | 0 extensions/rust/package.json | 2 +- ...aderlab.configuration.json => language-configuration.json} | 0 extensions/shaderlab/package.json | 2 +- ...lscript.configuration.json => language-configuration.json} | 0 extensions/shellscript/package.json | 2 +- .../{sql.configuration.json => language-configuration.json} | 0 extensions/sql/package.json | 2 +- .../{swift.configuration.json => language-configuration.json} | 0 extensions/swift/package.json | 2 +- .../vb/{vb.configuration.json => language-configuration.json} | 0 extensions/vb/package.json | 2 +- extensions/xml/package.json | 4 ++-- ...xml.configuration.json => xml.language-configuration.json} | 0 ...xsl.configuration.json => xsl.language-configuration.json} | 0 .../{yaml.configuration.json => language-configuration.json} | 0 extensions/yaml/package.json | 2 +- 64 files changed, 35 insertions(+), 35 deletions(-) rename extensions/bat/{bat.configuration.json => language-configuration.json} (100%) rename extensions/clojure/{clojure.configuration.json => language-configuration.json} (100%) rename extensions/coffeescript/{coffeescript.configuration.json => language-configuration.json} (100%) rename extensions/cpp/{cpp.configuration.json => language-configuration.json} (100%) rename extensions/diff/{diff.configuration.json => language-configuration.json} (100%) rename extensions/docker/{dockerfile.configuration.json => language-configuration.json} (100%) rename extensions/fsharp/{fsharp.configuration.json => language-configuration.json} (100%) rename extensions/git/{git-commit.configuration.json => git-commit.language-configuration.json} (100%) rename extensions/git/{git-rebase.configuration.json => git-rebase.language-configuration.json} (100%) rename extensions/go/{go.configuration.json => language-configuration.json} (100%) rename extensions/groovy/{groovy.configuration.json => language-configuration.json} (100%) rename extensions/ini/{ini.configuration.json => language-configuration.json} (100%) rename extensions/jade/{jade.configuration.json => language-configuration.json} (100%) rename extensions/java/{java.configuration.json => language-configuration.json} (100%) rename extensions/lua/{lua.configuration.json => language-configuration.json} (100%) rename extensions/make/{make.configuration.json => language-configuration.json} (100%) rename extensions/markdown/{markdown.configuration.json => language-configuration.json} (100%) rename extensions/objective-c/{objective-c.configuration.json => language-configuration.json} (100%) rename extensions/perl/{perl.configuration.json => perl.language-configuration.json} (100%) rename extensions/perl/{perl6.configuration.json => perl6.language-configuration.json} (100%) rename extensions/powershell/{powershell.configuration.json => language-configuration.json} (100%) rename extensions/python/{python.configuration.json => language-configuration.json} (100%) rename extensions/r/{r.configuration.json => language-configuration.json} (100%) rename extensions/ruby/{ruby.configuration.json => language-configuration.json} (100%) rename extensions/rust/{rust.configuration.json => language-configuration.json} (100%) rename extensions/shaderlab/{shaderlab.configuration.json => language-configuration.json} (100%) rename extensions/shellscript/{shellscript.configuration.json => language-configuration.json} (100%) rename extensions/sql/{sql.configuration.json => language-configuration.json} (100%) rename extensions/swift/{swift.configuration.json => language-configuration.json} (100%) rename extensions/vb/{vb.configuration.json => language-configuration.json} (100%) rename extensions/xml/{xml.configuration.json => xml.language-configuration.json} (100%) rename extensions/xml/{xsl.configuration.json => xsl.language-configuration.json} (100%) rename extensions/yaml/{yaml.configuration.json => language-configuration.json} (100%) diff --git a/extensions/bat/bat.configuration.json b/extensions/bat/language-configuration.json similarity index 100% rename from extensions/bat/bat.configuration.json rename to extensions/bat/language-configuration.json diff --git a/extensions/bat/package.json b/extensions/bat/package.json index f7d6cc598bd..e015ef20396 100644 --- a/extensions/bat/package.json +++ b/extensions/bat/package.json @@ -8,7 +8,7 @@ "id": "bat", "extensions": [ ".bat", ".cmd"], "aliases": [ "Batch", "bat" ], - "configuration": "./bat.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "bat", diff --git a/extensions/clojure/clojure.configuration.json b/extensions/clojure/language-configuration.json similarity index 100% rename from extensions/clojure/clojure.configuration.json rename to extensions/clojure/language-configuration.json diff --git a/extensions/clojure/package.json b/extensions/clojure/package.json index 3a67d006621..8d23bf932a3 100644 --- a/extensions/clojure/package.json +++ b/extensions/clojure/package.json @@ -8,7 +8,7 @@ "id": "clojure", "aliases": ["Clojure", "clojure"], "extensions": [".clj", ".cljs", ".cljx", ".clojure", ".edn"], - "configuration": "./clojure.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "clojure", diff --git a/extensions/coffeescript/coffeescript.configuration.json b/extensions/coffeescript/language-configuration.json similarity index 100% rename from extensions/coffeescript/coffeescript.configuration.json rename to extensions/coffeescript/language-configuration.json diff --git a/extensions/coffeescript/package.json b/extensions/coffeescript/package.json index fcc5e46bcb0..d75312ee3cd 100644 --- a/extensions/coffeescript/package.json +++ b/extensions/coffeescript/package.json @@ -8,7 +8,7 @@ "id": "coffeescript", "extensions": [ ".coffee", ".cson" ], "aliases": [ "CoffeeScript", "coffeescript", "coffee" ], - "configuration": "./coffeescript.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "coffeescript", diff --git a/extensions/cpp/cpp.configuration.json b/extensions/cpp/language-configuration.json similarity index 100% rename from extensions/cpp/cpp.configuration.json rename to extensions/cpp/language-configuration.json diff --git a/extensions/cpp/package.json b/extensions/cpp/package.json index d66e6415a28..c3bf4571e02 100644 --- a/extensions/cpp/package.json +++ b/extensions/cpp/package.json @@ -8,13 +8,13 @@ "id": "c", "extensions": [ ".c"], "aliases": [ "C", "c" ], - "configuration": "./cpp.configuration.json" + "configuration": "./language-configuration.json" }, { "id": "cpp", "extensions": [ ".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx", ".h", ".mm", ".ino", ".inl" ], "aliases": [ "C++", "Cpp", "cpp"], - "configuration": "./cpp.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "c", diff --git a/extensions/diff/diff.configuration.json b/extensions/diff/language-configuration.json similarity index 100% rename from extensions/diff/diff.configuration.json rename to extensions/diff/language-configuration.json diff --git a/extensions/diff/package.json b/extensions/diff/package.json index e8e34d275d3..64a1df166c1 100644 --- a/extensions/diff/package.json +++ b/extensions/diff/package.json @@ -9,7 +9,7 @@ "id": "diff", "aliases": ["Diff", "diff" ], "extensions": [".patch", ".diff", ".rej"], - "configuration": "./diff.configuration.json" + "configuration": "./language-configuration.json" } ], "grammars": [ diff --git a/extensions/docker/dockerfile.configuration.json b/extensions/docker/language-configuration.json similarity index 100% rename from extensions/docker/dockerfile.configuration.json rename to extensions/docker/language-configuration.json diff --git a/extensions/docker/package.json b/extensions/docker/package.json index 570e468cf22..2ae8f80b059 100644 --- a/extensions/docker/package.json +++ b/extensions/docker/package.json @@ -9,7 +9,7 @@ "extensions": [ ".dockerfile" ], "filenames": [ "Dockerfile" ], "aliases": [ "Dockerfile" ], - "configuration": "./dockerfile.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "dockerfile", diff --git a/extensions/fsharp/fsharp.configuration.json b/extensions/fsharp/language-configuration.json similarity index 100% rename from extensions/fsharp/fsharp.configuration.json rename to extensions/fsharp/language-configuration.json diff --git a/extensions/fsharp/package.json b/extensions/fsharp/package.json index 05000fd2cd4..898fc1e0d97 100644 --- a/extensions/fsharp/package.json +++ b/extensions/fsharp/package.json @@ -8,7 +8,7 @@ "id": "fsharp", "extensions": [ ".fs", ".fsi", ".ml", ".mli", ".fsx", ".fsscript" ], "aliases": [ "F#", "FSharp", "fsharp" ], - "configuration": "./fsharp.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "fsharp", diff --git a/extensions/git/git-commit.configuration.json b/extensions/git/git-commit.language-configuration.json similarity index 100% rename from extensions/git/git-commit.configuration.json rename to extensions/git/git-commit.language-configuration.json diff --git a/extensions/git/git-rebase.configuration.json b/extensions/git/git-rebase.language-configuration.json similarity index 100% rename from extensions/git/git-rebase.configuration.json rename to extensions/git/git-rebase.language-configuration.json diff --git a/extensions/git/package.json b/extensions/git/package.json index 2236861972c..9c1a593b4fc 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -9,13 +9,13 @@ "id": "git-commit", "aliases": ["Git Commit Message", "git-commit"], "filenames": ["COMMIT_EDITMSG", "MERGE_MSG"], - "configuration": "./git-commit.configuration.json" + "configuration": "./git-commit.language-configuration.json" }, { "id": "git-rebase", "aliases": ["Git Rebase Message", "git-rebase"], "filenames": ["git-rebase-todo"], - "configuration": "./git-rebase.configuration.json" + "configuration": "./git-rebase.language-configuration.json" } ], "grammars": [ diff --git a/extensions/go/go.configuration.json b/extensions/go/language-configuration.json similarity index 100% rename from extensions/go/go.configuration.json rename to extensions/go/language-configuration.json diff --git a/extensions/go/package.json b/extensions/go/package.json index 953074d391b..190424da466 100644 --- a/extensions/go/package.json +++ b/extensions/go/package.json @@ -8,7 +8,7 @@ "id": "go", "extensions": [ ".go" ], "aliases": [ "Go" ], - "configuration": "./go.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "go", diff --git a/extensions/groovy/groovy.configuration.json b/extensions/groovy/language-configuration.json similarity index 100% rename from extensions/groovy/groovy.configuration.json rename to extensions/groovy/language-configuration.json diff --git a/extensions/groovy/package.json b/extensions/groovy/package.json index 8580e847ebe..b3189b3497a 100644 --- a/extensions/groovy/package.json +++ b/extensions/groovy/package.json @@ -8,7 +8,7 @@ "id": "groovy", "aliases": ["Groovy", "groovy"], "extensions": [".groovy", ".gvy", ".gradle"], - "configuration": "./groovy.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "groovy", diff --git a/extensions/ini/ini.configuration.json b/extensions/ini/language-configuration.json similarity index 100% rename from extensions/ini/ini.configuration.json rename to extensions/ini/language-configuration.json diff --git a/extensions/ini/package.json b/extensions/ini/package.json index 14d80776a12..374e73d7162 100644 --- a/extensions/ini/package.json +++ b/extensions/ini/package.json @@ -9,7 +9,7 @@ "extensions": [ ".ini", ".properties", ".gitconfig" ], "filenames": ["config", ".gitattributes", ".gitconfig", "gitconfig", ".editorconfig"], "aliases": [ "Ini", "ini" ], - "configuration": "./ini.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "ini", diff --git a/extensions/jade/jade.configuration.json b/extensions/jade/language-configuration.json similarity index 100% rename from extensions/jade/jade.configuration.json rename to extensions/jade/language-configuration.json diff --git a/extensions/jade/package.json b/extensions/jade/package.json index dffde4288bf..cb83ee1b737 100644 --- a/extensions/jade/package.json +++ b/extensions/jade/package.json @@ -8,7 +8,7 @@ "id": "jade", "extensions": [ ".jade", ".pug" ], "aliases": [ "Jade", "jade" ], - "configuration": "./jade.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "jade", diff --git a/extensions/java/java.configuration.json b/extensions/java/language-configuration.json similarity index 100% rename from extensions/java/java.configuration.json rename to extensions/java/language-configuration.json diff --git a/extensions/java/package.json b/extensions/java/package.json index c7cc160debd..13e31ed33d4 100644 --- a/extensions/java/package.json +++ b/extensions/java/package.json @@ -8,7 +8,7 @@ "id": "java", "extensions": [ ".java", ".jav" ], "aliases": [ "Java", "java" ], - "configuration": "./java.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "java", diff --git a/extensions/json/package.json b/extensions/json/package.json index 5dc106c0022..a3ca6e17e74 100644 --- a/extensions/json/package.json +++ b/extensions/json/package.json @@ -55,7 +55,7 @@ "url": "vscode://schemas/vscode-extensions" }, { - "fileMatch": "language-configuration.json", + "fileMatch": "*language-configuration.json", "url": "vscode://schemas/language-configuration" }, { diff --git a/extensions/lua/lua.configuration.json b/extensions/lua/language-configuration.json similarity index 100% rename from extensions/lua/lua.configuration.json rename to extensions/lua/language-configuration.json diff --git a/extensions/lua/package.json b/extensions/lua/package.json index 80eb7bb3436..5465653c4a9 100644 --- a/extensions/lua/package.json +++ b/extensions/lua/package.json @@ -8,7 +8,7 @@ "id": "lua", "extensions": [ ".lua" ], "aliases": [ "Lua", "lua" ], - "configuration": "./lua.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "lua", diff --git a/extensions/make/make.configuration.json b/extensions/make/language-configuration.json similarity index 100% rename from extensions/make/make.configuration.json rename to extensions/make/language-configuration.json diff --git a/extensions/make/package.json b/extensions/make/package.json index fd78ad0f612..0527153f9a6 100644 --- a/extensions/make/package.json +++ b/extensions/make/package.json @@ -8,7 +8,7 @@ "id": "makefile", "aliases": ["Makefile", "makefile"], "filenames": [ "Makefile", "makefile", "GNUmakefile", "OCamlMakefile" ], - "configuration": "./make.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "makefile", diff --git a/extensions/markdown/markdown.configuration.json b/extensions/markdown/language-configuration.json similarity index 100% rename from extensions/markdown/markdown.configuration.json rename to extensions/markdown/language-configuration.json diff --git a/extensions/markdown/package.json b/extensions/markdown/package.json index 299de6bebb9..5207869953e 100644 --- a/extensions/markdown/package.json +++ b/extensions/markdown/package.json @@ -31,7 +31,7 @@ ".markdown", ".markdn" ], - "configuration": "./markdown.configuration.json" + "configuration": "./language-configuration.json" } ], "grammars": [ diff --git a/extensions/objective-c/objective-c.configuration.json b/extensions/objective-c/language-configuration.json similarity index 100% rename from extensions/objective-c/objective-c.configuration.json rename to extensions/objective-c/language-configuration.json diff --git a/extensions/objective-c/package.json b/extensions/objective-c/package.json index 8382daa427d..0313bf2b9a7 100644 --- a/extensions/objective-c/package.json +++ b/extensions/objective-c/package.json @@ -8,7 +8,7 @@ "id": "objective-c", "extensions": [ ".m" ], "aliases": [ "Objective-C"], - "configuration": "./objective-c.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "objective-c", diff --git a/extensions/perl/package.json b/extensions/perl/package.json index df5b3a9fe85..9b141930dd0 100644 --- a/extensions/perl/package.json +++ b/extensions/perl/package.json @@ -9,13 +9,13 @@ "aliases": ["Perl", "perl"], "extensions": [".pl", ".pm", ".pod", ".t", ".PL", ".psgi"], "firstLine": "^#!.*\\bperl\\b", - "configuration": "./perl.configuration.json" + "configuration": "./perl.language-configuration.json" }, { "id": "perl6", "aliases": ["Perl 6", "perl6"], "extensions": [".p6", ".pl6", ".pm6", ".nqp"], "firstLine": "(^#!.*\\bperl6\\b)|use\\s+v6", - "configuration": "./perl6.configuration.json" + "configuration": "./perl6.language-configuration.json" }], "grammars": [{ "language": "perl", diff --git a/extensions/perl/perl.configuration.json b/extensions/perl/perl.language-configuration.json similarity index 100% rename from extensions/perl/perl.configuration.json rename to extensions/perl/perl.language-configuration.json diff --git a/extensions/perl/perl6.configuration.json b/extensions/perl/perl6.language-configuration.json similarity index 100% rename from extensions/perl/perl6.configuration.json rename to extensions/perl/perl6.language-configuration.json diff --git a/extensions/powershell/powershell.configuration.json b/extensions/powershell/language-configuration.json similarity index 100% rename from extensions/powershell/powershell.configuration.json rename to extensions/powershell/language-configuration.json diff --git a/extensions/powershell/package.json b/extensions/powershell/package.json index 7fee9af3e24..47b6c419c6f 100644 --- a/extensions/powershell/package.json +++ b/extensions/powershell/package.json @@ -8,7 +8,7 @@ "id": "powershell", "extensions": [ ".ps1", ".psm1", ".psd1", ".pssc", ".psrc" ], "aliases": [ "PowerShell", "powershell", "ps", "ps1" ], - "configuration": "./powershell.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "powershell", diff --git a/extensions/python/python.configuration.json b/extensions/python/language-configuration.json similarity index 100% rename from extensions/python/python.configuration.json rename to extensions/python/language-configuration.json diff --git a/extensions/python/package.json b/extensions/python/package.json index 688862a4717..e93560fcb42 100644 --- a/extensions/python/package.json +++ b/extensions/python/package.json @@ -9,7 +9,7 @@ "extensions": [ ".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi" ], "aliases": [ "Python", "py" ], "firstLine": "^#!/.*\\bpython[0-9.-]*\\b", - "configuration": "./python.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "python", diff --git a/extensions/r/r.configuration.json b/extensions/r/language-configuration.json similarity index 100% rename from extensions/r/r.configuration.json rename to extensions/r/language-configuration.json diff --git a/extensions/r/package.json b/extensions/r/package.json index 2a025c98160..a41d8ef1488 100644 --- a/extensions/r/package.json +++ b/extensions/r/package.json @@ -8,7 +8,7 @@ "id": "r", "extensions": [ ".r", ".rhistory", ".rprofile", ".rt" ], "aliases": [ "R", "r" ], - "configuration": "./r.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "r", diff --git a/extensions/ruby/ruby.configuration.json b/extensions/ruby/language-configuration.json similarity index 100% rename from extensions/ruby/ruby.configuration.json rename to extensions/ruby/language-configuration.json diff --git a/extensions/ruby/package.json b/extensions/ruby/package.json index e06a400ad22..e58710ddac7 100644 --- a/extensions/ruby/package.json +++ b/extensions/ruby/package.json @@ -9,7 +9,7 @@ "extensions": [ ".rb", ".rbx", ".rjs", ".gemspec", ".pp", ".rake", ".ru" ], "filenames": [ "rakefile", "gemfile", "guardfile" ], "aliases": [ "Ruby", "rb" ], - "configuration": "./ruby.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "ruby", diff --git a/extensions/rust/rust.configuration.json b/extensions/rust/language-configuration.json similarity index 100% rename from extensions/rust/rust.configuration.json rename to extensions/rust/language-configuration.json diff --git a/extensions/rust/package.json b/extensions/rust/package.json index 8f0d9ad516c..b771b3624f2 100644 --- a/extensions/rust/package.json +++ b/extensions/rust/package.json @@ -8,7 +8,7 @@ "id": "rust", "extensions": [".rs"], "aliases": ["Rust", "rust"], - "configuration": "./rust.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "rust", diff --git a/extensions/shaderlab/shaderlab.configuration.json b/extensions/shaderlab/language-configuration.json similarity index 100% rename from extensions/shaderlab/shaderlab.configuration.json rename to extensions/shaderlab/language-configuration.json diff --git a/extensions/shaderlab/package.json b/extensions/shaderlab/package.json index 9c10e6b1df9..52cb3b7da98 100644 --- a/extensions/shaderlab/package.json +++ b/extensions/shaderlab/package.json @@ -8,7 +8,7 @@ "id": "shaderlab", "extensions": [".shader", ".cginc"], "aliases": ["ShaderLab", "shaderlab"], - "configuration": "./shaderlab.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "shaderlab", diff --git a/extensions/shellscript/shellscript.configuration.json b/extensions/shellscript/language-configuration.json similarity index 100% rename from extensions/shellscript/shellscript.configuration.json rename to extensions/shellscript/language-configuration.json diff --git a/extensions/shellscript/package.json b/extensions/shellscript/package.json index 635196d327c..14a13ccc55a 100644 --- a/extensions/shellscript/package.json +++ b/extensions/shellscript/package.json @@ -10,7 +10,7 @@ "extensions": [".sh", ".bash", ".bashrc", ".bash_profile", ".bash_login", ".ebuild", ".install", ".profile", ".bash_logout", ".zsh", ".zshrc", ".zprofile", ".zlogin", ".zlogout", ".zshenv"], "filenames": ["PKGBUILD"], "firstLine": "^#!.*\\b(bash|zsh|sh|tcsh)|^#\\s*-\\*-[^*]*mode:\\s*shell-script[^*]*-\\*-", - "configuration": "./shellscript.configuration.json", + "configuration": "./language-configuration.json", "mimetypes": ["text/x-shellscript"] }], "grammars": [{ diff --git a/extensions/sql/sql.configuration.json b/extensions/sql/language-configuration.json similarity index 100% rename from extensions/sql/sql.configuration.json rename to extensions/sql/language-configuration.json diff --git a/extensions/sql/package.json b/extensions/sql/package.json index 64714208006..8a47958d254 100644 --- a/extensions/sql/package.json +++ b/extensions/sql/package.json @@ -8,7 +8,7 @@ "id": "sql", "extensions": [ ".sql" ], "aliases": [ "SQL" ], - "configuration": "./sql.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "sql", diff --git a/extensions/swift/swift.configuration.json b/extensions/swift/language-configuration.json similarity index 100% rename from extensions/swift/swift.configuration.json rename to extensions/swift/language-configuration.json diff --git a/extensions/swift/package.json b/extensions/swift/package.json index a63033114aa..b8f262b4cff 100644 --- a/extensions/swift/package.json +++ b/extensions/swift/package.json @@ -8,7 +8,7 @@ "id": "swift", "aliases": ["Swift","swift"], "extensions": [".swift"], - "configuration": "./swift.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "swift", diff --git a/extensions/vb/vb.configuration.json b/extensions/vb/language-configuration.json similarity index 100% rename from extensions/vb/vb.configuration.json rename to extensions/vb/language-configuration.json diff --git a/extensions/vb/package.json b/extensions/vb/package.json index 90c2342c71d..530654e607d 100644 --- a/extensions/vb/package.json +++ b/extensions/vb/package.json @@ -8,7 +8,7 @@ "id": "vb", "extensions": [ ".vb", ".brs", ".vbs", ".bas" ], "aliases": [ "Visual Basic", "vb" ], - "configuration": "./vb.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "vb", diff --git a/extensions/xml/package.json b/extensions/xml/package.json index e471964623a..2b0fc573b6b 100644 --- a/extensions/xml/package.json +++ b/extensions/xml/package.json @@ -64,7 +64,7 @@ ], "firstLine" : "(\\<\\?xml.*)|(\\