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/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/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/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/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 cd9a9c908f1..a3ca6e17e74 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": [ @@ -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/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/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/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 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/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/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/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 40d4c006180..319e46a8460 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 197559ac318..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,22 +195,7 @@ class LanguageProvider { beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/, action: { indentAction: IndentAction.None, removeText: 1 } } - ], - - __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'] } - ] - } + ] }); }); } 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.*)|(\\ 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/node/languageConfiguration.ts b/src/vs/editor/node/languageConfiguration.ts index 978827da063..12c8edab83c 100644 --- a/src/vs/editor/node/languageConfiguration.ts +++ b/src/vs/editor/node/languageConfiguration.ts @@ -9,8 +9,11 @@ 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'; +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]; @@ -22,8 +25,8 @@ interface ICommentRule { interface ILanguageConfiguration { comments?: ICommentRule; brackets?: CharacterPair[]; - autoClosingPairs?: CharacterPair[]; - surroundingPairs?: CharacterPair[]; + autoClosingPairs?: (CharacterPair | IAutoClosingPairConditional)[]; + surroundingPairs?: (CharacterPair | IAutoClosingPair)[]; } export class LanguageConfigurationFileHandler { @@ -92,10 +95,135 @@ 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; }); } } + +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); 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' }, diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index aeb2f2c3ed2..b7084999baa 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -2500,6 +2500,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; @@ -2511,7 +2517,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: {