提交 70aa7ac5 编写于 作者: M Martin Aeschlimann 提交者: GitHub

Merge pull request #9595 from Microsoft/aeschli/languageconfiguration-cleanup

Replace deprecated __ language APIs with language-configuration alternative
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "bat", "id": "bat",
"extensions": [ ".bat", ".cmd"], "extensions": [ ".bat", ".cmd"],
"aliases": [ "Batch", "bat" ], "aliases": [ "Batch", "bat" ],
"configuration": "./bat.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "bat", "language": "bat",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "clojure", "id": "clojure",
"aliases": ["Clojure", "clojure"], "aliases": ["Clojure", "clojure"],
"extensions": [".clj", ".cljs", ".cljx", ".clojure", ".edn"], "extensions": [".clj", ".cljs", ".cljx", ".clojure", ".edn"],
"configuration": "./clojure.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "clojure", "language": "clojure",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "coffeescript", "id": "coffeescript",
"extensions": [ ".coffee", ".cson" ], "extensions": [ ".coffee", ".cson" ],
"aliases": [ "CoffeeScript", "coffeescript", "coffee" ], "aliases": [ "CoffeeScript", "coffeescript", "coffee" ],
"configuration": "./coffeescript.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "coffeescript", "language": "coffeescript",
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
"id": "c", "id": "c",
"extensions": [ ".c"], "extensions": [ ".c"],
"aliases": [ "C", "c" ], "aliases": [ "C", "c" ],
"configuration": "./cpp.configuration.json" "configuration": "./language-configuration.json"
}, },
{ {
"id": "cpp", "id": "cpp",
"extensions": [ ".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx", ".h", ".mm", ".ino", ".inl" ], "extensions": [ ".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx", ".h", ".mm", ".ino", ".inl" ],
"aliases": [ "C++", "Cpp", "cpp"], "aliases": [ "C++", "Cpp", "cpp"],
"configuration": "./cpp.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "c", "language": "c",
......
...@@ -54,58 +54,15 @@ export function activate(context: ExtensionContext) { ...@@ -54,58 +54,15 @@ export function activate(context: ExtensionContext) {
context.subscriptions.push(disposable); context.subscriptions.push(disposable);
languages.setLanguageConfiguration('css', { languages.setLanguageConfiguration('css', {
wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\w-?]+%?|[@#!.])/g, 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'] }
]
}
}); });
languages.setLanguageConfiguration('less', { languages.setLanguageConfiguration('less', {
wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]+(?=[^,{;]*[,{]))|(([@#.!])?[\w-?]+%?|[@#!.])/g, 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'] },
]
}
}); });
languages.setLanguageConfiguration('scss', { languages.setLanguageConfiguration('scss', {
wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]*(?=[^,{;]*[,{]))|(([@$#.!])?[\w-?]+%?|[@#!$.])/g, 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'] },
]
}
}); });
commands.registerCommand('_css.applyCodeAction', applyCodeAction); commands.registerCommand('_css.applyCodeAction', applyCodeAction);
......
{
"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
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
"id": "css", "id": "css",
"aliases": ["CSS", "css"], "aliases": ["CSS", "css"],
"extensions": [".css"], "extensions": [".css"],
"mimetypes": ["text/css"] "mimetypes": ["text/css"],
"configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "css", "language": "css",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"id": "diff", "id": "diff",
"aliases": ["Diff", "diff" ], "aliases": ["Diff", "diff" ],
"extensions": [".patch", ".diff", ".rej"], "extensions": [".patch", ".diff", ".rej"],
"configuration": "./diff.configuration.json" "configuration": "./language-configuration.json"
} }
], ],
"grammars": [ "grammars": [
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"extensions": [ ".dockerfile" ], "extensions": [ ".dockerfile" ],
"filenames": [ "Dockerfile" ], "filenames": [ "Dockerfile" ],
"aliases": [ "Dockerfile" ], "aliases": [ "Dockerfile" ],
"configuration": "./dockerfile.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "dockerfile", "language": "dockerfile",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "fsharp", "id": "fsharp",
"extensions": [ ".fs", ".fsi", ".ml", ".mli", ".fsx", ".fsscript" ], "extensions": [ ".fs", ".fsi", ".ml", ".mli", ".fsx", ".fsscript" ],
"aliases": [ "F#", "FSharp", "fsharp" ], "aliases": [ "F#", "FSharp", "fsharp" ],
"configuration": "./fsharp.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "fsharp", "language": "fsharp",
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
"id": "git-commit", "id": "git-commit",
"aliases": ["Git Commit Message", "git-commit"], "aliases": ["Git Commit Message", "git-commit"],
"filenames": ["COMMIT_EDITMSG", "MERGE_MSG"], "filenames": ["COMMIT_EDITMSG", "MERGE_MSG"],
"configuration": "./git-commit.configuration.json" "configuration": "./git-commit.language-configuration.json"
}, },
{ {
"id": "git-rebase", "id": "git-rebase",
"aliases": ["Git Rebase Message", "git-rebase"], "aliases": ["Git Rebase Message", "git-rebase"],
"filenames": ["git-rebase-todo"], "filenames": ["git-rebase-todo"],
"configuration": "./git-rebase.configuration.json" "configuration": "./git-rebase.language-configuration.json"
} }
], ],
"grammars": [ "grammars": [
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "go", "id": "go",
"extensions": [ ".go" ], "extensions": [ ".go" ],
"aliases": [ "Go" ], "aliases": [ "Go" ],
"configuration": "./go.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "go", "language": "go",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "groovy", "id": "groovy",
"aliases": ["Groovy", "groovy"], "aliases": ["Groovy", "groovy"],
"extensions": [".groovy", ".gvy", ".gradle"], "extensions": [".groovy", ".gvy", ".gradle"],
"configuration": "./groovy.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "groovy", "language": "groovy",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"extensions": [ ".ini", ".properties", ".gitconfig" ], "extensions": [ ".ini", ".properties", ".gitconfig" ],
"filenames": ["config", ".gitattributes", ".gitconfig", "gitconfig", ".editorconfig"], "filenames": ["config", ".gitattributes", ".gitconfig", "gitconfig", ".editorconfig"],
"aliases": [ "Ini", "ini" ], "aliases": [ "Ini", "ini" ],
"configuration": "./ini.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "ini", "language": "ini",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "jade", "id": "jade",
"extensions": [ ".jade", ".pug" ], "extensions": [ ".jade", ".pug" ],
"aliases": [ "Jade", "jade" ], "aliases": [ "Jade", "jade" ],
"configuration": "./jade.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "jade", "language": "jade",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "java", "id": "java",
"extensions": [ ".java", ".jav" ], "extensions": [ ".java", ".jav" ],
"aliases": [ "Java", "java" ], "aliases": [ "Java", "java" ],
"configuration": "./java.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "java", "language": "java",
......
{
"comments": {
"lineComment": "//",
"blockComment": [ "/*", "*/" ]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
]
}
\ No newline at end of file
{
"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
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"extensions": [ "extensions": [
".jsx" ".jsx"
], ],
"configuration": "./javascript.configuration.json" "configuration": "./language-configuration.json"
}, },
{ {
"id": "javascript", "id": "javascript",
...@@ -46,7 +46,8 @@ ...@@ -46,7 +46,8 @@
"firstLine": "^#!.*\\bnode", "firstLine": "^#!.*\\bnode",
"mimetypes": [ "mimetypes": [
"text/javascript" "text/javascript"
] ],
"configuration": "./language-configuration.json"
} }
], ],
"grammars": [ "grammars": [
......
...@@ -89,17 +89,7 @@ export function activate(context: ExtensionContext) { ...@@ -89,17 +89,7 @@ export function activate(context: ExtensionContext) {
context.subscriptions.push(disposable); context.subscriptions.push(disposable);
languages.setLanguageConfiguration('json', { languages.setLanguageConfiguration('json', {
wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g, 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'] }
]
}
}); });
}); });
} }
......
{
"comments": {
"lineComment": "//",
"blockComment": [ "/*", "*/" ]
},
"brackets": [
["{", "}"],
["[", "]"]
]
}
\ No newline at end of file
{
"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
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
"application/json", "application/json",
"application/manifest+json" "application/manifest+json"
], ],
"configuration": "./json.configuration.json" "configuration": "./language-configuration.json"
} }
], ],
"grammars": [ "grammars": [
...@@ -54,6 +54,10 @@ ...@@ -54,6 +54,10 @@
"fileMatch": "package.json", "fileMatch": "package.json",
"url": "vscode://schemas/vscode-extensions" "url": "vscode://schemas/vscode-extensions"
}, },
{
"fileMatch": "*language-configuration.json",
"url": "vscode://schemas/language-configuration"
},
{ {
"fileMatch": "vscode://defaultsettings/keybindings.json", "fileMatch": "vscode://defaultsettings/keybindings.json",
"url": "vscode://schemas/keybindings" "url": "vscode://schemas/keybindings"
......
{
"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
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
"id": "less", "id": "less",
"aliases": ["Less", "less"], "aliases": ["Less", "less"],
"extensions": [".less"], "extensions": [".less"],
"mimetypes": ["text/x-less", "text/less"] "mimetypes": ["text/x-less", "text/less"],
"configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "less", "language": "less",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "lua", "id": "lua",
"extensions": [ ".lua" ], "extensions": [ ".lua" ],
"aliases": [ "Lua", "lua" ], "aliases": [ "Lua", "lua" ],
"configuration": "./lua.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "lua", "language": "lua",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "makefile", "id": "makefile",
"aliases": ["Makefile", "makefile"], "aliases": ["Makefile", "makefile"],
"filenames": [ "Makefile", "makefile", "GNUmakefile", "OCamlMakefile" ], "filenames": [ "Makefile", "makefile", "GNUmakefile", "OCamlMakefile" ],
"configuration": "./make.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "makefile", "language": "makefile",
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
".markdown", ".markdown",
".markdn" ".markdn"
], ],
"configuration": "./markdown.configuration.json" "configuration": "./language-configuration.json"
} }
], ],
"grammars": [ "grammars": [
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "objective-c", "id": "objective-c",
"extensions": [ ".m" ], "extensions": [ ".m" ],
"aliases": [ "Objective-C"], "aliases": [ "Objective-C"],
"configuration": "./objective-c.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "objective-c", "language": "objective-c",
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
"aliases": ["Perl", "perl"], "aliases": ["Perl", "perl"],
"extensions": [".pl", ".pm", ".pod", ".t", ".PL", ".psgi"], "extensions": [".pl", ".pm", ".pod", ".t", ".PL", ".psgi"],
"firstLine": "^#!.*\\bperl\\b", "firstLine": "^#!.*\\bperl\\b",
"configuration": "./perl.configuration.json" "configuration": "./perl.language-configuration.json"
}, { }, {
"id": "perl6", "id": "perl6",
"aliases": ["Perl 6", "perl6"], "aliases": ["Perl 6", "perl6"],
"extensions": [".p6", ".pl6", ".pm6", ".nqp"], "extensions": [".p6", ".pl6", ".pm6", ".nqp"],
"firstLine": "(^#!.*\\bperl6\\b)|use\\s+v6", "firstLine": "(^#!.*\\bperl6\\b)|use\\s+v6",
"configuration": "./perl6.configuration.json" "configuration": "./perl6.language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "perl", "language": "perl",
......
...@@ -7,6 +7,13 @@ ...@@ -7,6 +7,13 @@
["{", "}"], ["{", "}"],
["[", "]"], ["[", "]"],
["(", ")"] ["(", ")"]
],
"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
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"extensions": [ ".php", ".php4", ".php5", ".phtml", ".ctp" ], "extensions": [ ".php", ".php4", ".php5", ".phtml", ".ctp" ],
"aliases": [ "PHP", "php" ], "aliases": [ "PHP", "php" ],
"mimetypes": ["application/x-php"], "mimetypes": ["application/x-php"],
"configuration": "./php.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "php", "language": "php",
......
...@@ -26,16 +26,6 @@ export function activate(context: ExtensionContext): any { ...@@ -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. // need to set in the extension host as well as the completion provider uses it.
languages.setLanguageConfiguration('php', { languages.setLanguageConfiguration('php', {
wordPattern: /(-?\d*\.\d\w*)|([^\-\`\~\!\@\#\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\-\`\~\!\@\#\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g
__characterPairSupport: {
autoClosingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"', notIn: ['string'] },
{ open: '\'', close: '\'', notIn: ['string', 'comment'] }
]
}
}); });
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "powershell", "id": "powershell",
"extensions": [ ".ps1", ".psm1", ".psd1", ".pssc", ".psrc" ], "extensions": [ ".ps1", ".psm1", ".psd1", ".pssc", ".psrc" ],
"aliases": [ "PowerShell", "powershell", "ps", "ps1" ], "aliases": [ "PowerShell", "powershell", "ps", "ps1" ],
"configuration": "./powershell.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "powershell", "language": "powershell",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"extensions": [ ".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi" ], "extensions": [ ".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi" ],
"aliases": [ "Python", "py" ], "aliases": [ "Python", "py" ],
"firstLine": "^#!/.*\\bpython[0-9.-]*\\b", "firstLine": "^#!/.*\\bpython[0-9.-]*\\b",
"configuration": "./python.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "python", "language": "python",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "r", "id": "r",
"extensions": [ ".r", ".rhistory", ".rprofile", ".rt" ], "extensions": [ ".r", ".rhistory", ".rprofile", ".rt" ],
"aliases": [ "R", "r" ], "aliases": [ "R", "r" ],
"configuration": "./r.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "r", "language": "r",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"extensions": [ ".rb", ".rbx", ".rjs", ".gemspec", ".pp", ".rake", ".ru" ], "extensions": [ ".rb", ".rbx", ".rjs", ".gemspec", ".pp", ".rake", ".ru" ],
"filenames": [ "rakefile", "gemfile", "guardfile" ], "filenames": [ "rakefile", "gemfile", "guardfile" ],
"aliases": [ "Ruby", "rb" ], "aliases": [ "Ruby", "rb" ],
"configuration": "./ruby.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "ruby", "language": "ruby",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "rust", "id": "rust",
"extensions": [".rs"], "extensions": [".rs"],
"aliases": ["Rust", "rust"], "aliases": ["Rust", "rust"],
"configuration": "./rust.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "rust", "language": "rust",
......
{
"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
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
"id": "scss", "id": "scss",
"aliases": ["Sass", "scss"], "aliases": ["Sass", "scss"],
"extensions": [".scss"], "extensions": [".scss"],
"mimetypes": ["text/x-scss", "text/scss"] "mimetypes": ["text/x-scss", "text/scss"],
"configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "scss", "language": "scss",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "shaderlab", "id": "shaderlab",
"extensions": [".shader", ".cginc"], "extensions": [".shader", ".cginc"],
"aliases": ["ShaderLab", "shaderlab"], "aliases": ["ShaderLab", "shaderlab"],
"configuration": "./shaderlab.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "shaderlab", "language": "shaderlab",
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"extensions": [".sh", ".bash", ".bashrc", ".bash_profile", ".bash_login", ".ebuild", ".install", ".profile", ".bash_logout", ".zsh", ".zshrc", ".zprofile", ".zlogin", ".zlogout", ".zshenv"], "extensions": [".sh", ".bash", ".bashrc", ".bash_profile", ".bash_login", ".ebuild", ".install", ".profile", ".bash_logout", ".zsh", ".zshrc", ".zprofile", ".zlogin", ".zlogout", ".zshenv"],
"filenames": ["PKGBUILD"], "filenames": ["PKGBUILD"],
"firstLine": "^#!.*\\b(bash|zsh|sh|tcsh)|^#\\s*-\\*-[^*]*mode:\\s*shell-script[^*]*-\\*-", "firstLine": "^#!.*\\b(bash|zsh|sh|tcsh)|^#\\s*-\\*-[^*]*mode:\\s*shell-script[^*]*-\\*-",
"configuration": "./shellscript.configuration.json", "configuration": "./language-configuration.json",
"mimetypes": ["text/x-shellscript"] "mimetypes": ["text/x-shellscript"]
}], }],
"grammars": [{ "grammars": [{
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "sql", "id": "sql",
"extensions": [ ".sql" ], "extensions": [ ".sql" ],
"aliases": [ "SQL" ], "aliases": [ "SQL" ],
"configuration": "./sql.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "sql", "language": "sql",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "swift", "id": "swift",
"aliases": ["Swift","swift"], "aliases": ["Swift","swift"],
"extensions": [".swift"], "extensions": [".swift"],
"configuration": "./swift.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "swift", "language": "swift",
......
{
"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
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
], ],
"extensions": [ "extensions": [
".ts" ".ts"
] ],
"configuration": "./language-configuration.json"
}, },
{ {
"id": "typescriptreact", "id": "typescriptreact",
...@@ -47,7 +48,8 @@ ...@@ -47,7 +48,8 @@
], ],
"extensions": [ "extensions": [
".tsx" ".tsx"
] ],
"configuration": "./language-configuration.json"
} }
], ],
"grammars": [ "grammars": [
......
...@@ -168,15 +168,6 @@ class LanguageProvider { ...@@ -168,15 +168,6 @@ class LanguageProvider {
increaseIndentPattern: /^.*\{[^}"']*$/ increaseIndentPattern: /^.*\{[^}"']*$/
}, },
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: {
lineComment: '//',
blockComment: ['/*', '*/']
},
brackets: [
['{', '}'],
['[', ']'],
['(', ')'],
],
onEnterRules: [ onEnterRules: [
{ {
// e.g. /** | */ // e.g. /** | */
...@@ -204,22 +195,7 @@ class LanguageProvider { ...@@ -204,22 +195,7 @@ class LanguageProvider {
beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/, beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/,
action: { indentAction: IndentAction.None, removeText: 1 } 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'] }
]
}
}); });
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"id": "vb", "id": "vb",
"extensions": [ ".vb", ".brs", ".vbs", ".bas" ], "extensions": [ ".vb", ".brs", ".vbs", ".bas" ],
"aliases": [ "Visual Basic", "vb" ], "aliases": [ "Visual Basic", "vb" ],
"configuration": "./vb.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "vb", "language": "vb",
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
], ],
"firstLine" : "(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)", "firstLine" : "(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",
"aliases": [ "XML", "xml" ], "aliases": [ "XML", "xml" ],
"configuration": "./xml.configuration.json" "configuration": "./xml.language-configuration.json"
}, { }, {
"id": "xsl", "id": "xsl",
"extensions": [ "extensions": [
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
".xslt" ".xslt"
], ],
"aliases": [ "XSL", "xsl" ], "aliases": [ "XSL", "xsl" ],
"configuration": "./xsl.configuration.json" "configuration": "./xsl.language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "xml", "language": "xml",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"aliases": ["YAML", "yaml"], "aliases": ["YAML", "yaml"],
"extensions": [".eyaml", ".eyml", ".yaml", ".yml"], "extensions": [".eyaml", ".eyml", ".yaml", ".yml"],
"firstLine": "^#cloud-config", "firstLine": "^#cloud-config",
"configuration": "./yaml.configuration.json" "configuration": "./language-configuration.json"
}], }],
"grammars": [{ "grammars": [{
"language": "yaml", "language": "yaml",
......
...@@ -879,6 +879,7 @@ export type CharacterPair = [string, string]; ...@@ -879,6 +879,7 @@ export type CharacterPair = [string, string];
export interface IAutoClosingPairConditional extends IAutoClosingPair { export interface IAutoClosingPairConditional extends IAutoClosingPair {
notIn?: string[]; notIn?: string[];
} }
/** /**
......
...@@ -111,10 +111,7 @@ export class RichEditSupport { ...@@ -111,10 +111,7 @@ export class RichEditSupport {
this._handleComments(modeId, this._conf); this._handleComments(modeId, this._conf);
this.characterPair = new CharacterPairSupport(LanguageConfigurationRegistry, modeId, this._conf); this.characterPair = new CharacterPairSupport(LanguageConfigurationRegistry, modeId, this._conf);
this.electricCharacter = new BracketElectricCharacterSupport(LanguageConfigurationRegistry, modeId, this.brackets, this.characterPair.getAutoClosingPairs(), this._conf.__electricCharacterSupport);
if (this._conf.__electricCharacterSupport || this._conf.brackets) {
this.electricCharacter = new BracketElectricCharacterSupport(LanguageConfigurationRegistry, modeId, this.brackets, this._conf.__electricCharacterSupport);
}
this.wordDefinition = this._conf.wordPattern || DEFAULT_WORD_REGEXP; this.wordDefinition = this._conf.wordPattern || DEFAULT_WORD_REGEXP;
} }
......
...@@ -32,11 +32,11 @@ export class BracketElectricCharacterSupport implements modes.IRichEditElectricC ...@@ -32,11 +32,11 @@ export class BracketElectricCharacterSupport implements modes.IRichEditElectricC
private contribution: IBracketElectricCharacterContribution; private contribution: IBracketElectricCharacterContribution;
private brackets: Brackets; 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._registry = registry;
this._modeId = modeId; this._modeId = modeId;
this.contribution = contribution || {}; this.contribution = contribution || {};
this.brackets = new Brackets(modeId, brackets, this.contribution.docComment); this.brackets = new Brackets(modeId, brackets, autoClosePairs, this.contribution.docComment);
} }
public getElectricCharacters(): string[]{ public getElectricCharacters(): string[]{
...@@ -66,12 +66,16 @@ export class Brackets { ...@@ -66,12 +66,16 @@ export class Brackets {
private _modeId: string; private _modeId: string;
private _richEditBrackets: modes.IRichEditBrackets; 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._modeId = modeId;
this._richEditBrackets = richEditBrackets; 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[] { public getElectricCharacters():string[] {
...@@ -85,9 +89,9 @@ export class Brackets { ...@@ -85,9 +89,9 @@ export class Brackets {
} }
} }
// Doc comments // auto close
if (this._docComment){ for (let pair of this._complexAutoClosePairs) {
result.push(this._docComment.open.charAt(this._docComment.open.length - 1)); result.push(pair.open.charAt(pair.open.length - 1));
} }
// Filter duplicate entries // Filter duplicate entries
...@@ -103,8 +107,8 @@ export class Brackets { ...@@ -103,8 +107,8 @@ export class Brackets {
return null; return null;
} }
return (this._onElectricCharacterDocComment(context, offset) || return (this._onElectricAutoClose(context, offset) ||
this._onElectricCharacterStandardBrackets(context, offset)); this._onElectricAutoIndent(context, offset));
} }
private containsTokenTypes(fullTokenSpec: string, tokensToLookFor: string): boolean { private containsTokenTypes(fullTokenSpec: string, tokensToLookFor: string): boolean {
...@@ -117,7 +121,7 @@ export class Brackets { ...@@ -117,7 +121,7 @@ export class Brackets {
return true; 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) { if (!this._richEditBrackets || this._richEditBrackets.brackets.length === 0) {
return null; return null;
...@@ -151,35 +155,44 @@ export class Brackets { ...@@ -151,35 +155,44 @@ export class Brackets {
return null; return null;
} }
private _onElectricCharacterDocComment(context: modes.ILineContext, offset: number): modes.IElectricAction { private _onElectricAutoClose(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) { if (!this._complexAutoClosePairs.length) {
return null; return null;
} }
var line = context.getLineContent(); var line = context.getLineContent();
var char: string = line[offset]; var char: string = line[offset];
// See if the right electric character was pressed for (let i = 0; i < this._complexAutoClosePairs.length; i++) {
if (char !== this._docComment.open.charAt(this._docComment.open.length - 1)) { let pair = this._complexAutoClosePairs[i];
return null;
}
// If this line already contains the closing tag, do nothing. // See if the right electric character was pressed
if (line.indexOf(this._docComment.close, offset) >= 0) { if (char !== pair.open.charAt(pair.open.length - 1)) {
return null; continue;
} }
// If we're not in a documentation comment, do nothing. // If this line already contains the closing tag, do nothing.
var lastTokenIndex = context.findIndexOfOffset(offset); if (line.indexOf(pair.close, offset) >= 0) {
if (! this.containsTokenTypes(context.getTokenType(lastTokenIndex), this._docComment.scope)) { continue;
return null; }
}
if (line.substring(context.getTokenStartIndex(lastTokenIndex), offset+1/* include electric char*/) !== this._docComment.open) { // check if the full open bracket matches
return null; 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};
} }
return { appendText: this._docComment.close};
} }
} }
...@@ -9,8 +9,11 @@ import {parse} from 'vs/base/common/json'; ...@@ -9,8 +9,11 @@ import {parse} from 'vs/base/common/json';
import {readFile} from 'vs/base/node/pfs'; import {readFile} from 'vs/base/node/pfs';
import {LanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry'; import {LanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {IModeService} from 'vs/editor/common/services/modeService'; 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 {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]; type CharacterPair = [string, string];
...@@ -22,8 +25,8 @@ interface ICommentRule { ...@@ -22,8 +25,8 @@ interface ICommentRule {
interface ILanguageConfiguration { interface ILanguageConfiguration {
comments?: ICommentRule; comments?: ICommentRule;
brackets?: CharacterPair[]; brackets?: CharacterPair[];
autoClosingPairs?: CharacterPair[]; autoClosingPairs?: (CharacterPair | IAutoClosingPairConditional)[];
surroundingPairs?: CharacterPair[]; surroundingPairs?: (CharacterPair | IAutoClosingPair)[];
} }
export class LanguageConfigurationFileHandler { export class LanguageConfigurationFileHandler {
...@@ -92,10 +95,135 @@ export class LanguageConfigurationFileHandler { ...@@ -92,10 +95,135 @@ export class LanguageConfigurationFileHandler {
LanguageConfigurationRegistry.register(modeId, richEditConfig); LanguageConfigurationRegistry.register(modeId, richEditConfig);
} }
private _mapCharacterPairs(pairs:CharacterPair[]): IAutoClosingPair[] { private _mapCharacterPairs(pairs: (CharacterPair | IAutoClosingPairConditional)[]): IAutoClosingPairConditional[] {
return pairs.map(pair => { return pairs.map(pair => {
let [open, close] = pair; if (Array.isArray(pair)) {
return { open: open, close: close }; return { open: pair[0], close: pair[1] };
}
return <IAutoClosingPairConditional> 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 = <IJSONContributionRegistry>Registry.as(Extensions.JSONContribution);
schemaRegistry.registerSchema(schemaId, schema);
...@@ -10,8 +10,7 @@ import {createLineContextFromTokenText} from 'vs/editor/test/common/modesTestUti ...@@ -10,8 +10,7 @@ import {createLineContextFromTokenText} from 'vs/editor/test/common/modesTestUti
suite('Editor Modes - Auto Indentation', () => { suite('Editor Modes - Auto Indentation', () => {
test('Doc comments', () => { test('Doc comments', () => {
var brackets = new Brackets('test', null, var brackets = new Brackets('test', null, [{ open: '/**', close: ' */' }]);
{ scope: 'doc', open: '/**', lineStart: ' * ', close: ' */' });
assert.equal(brackets.onElectricCharacter(createLineContextFromTokenText([ assert.equal(brackets.onElectricCharacter(createLineContextFromTokenText([
{ text: '/**', type: 'doc' }, { text: '/**', type: 'doc' },
......
...@@ -2500,6 +2500,12 @@ declare namespace vscode { ...@@ -2500,6 +2500,12 @@ declare namespace vscode {
* @deprecated * @deprecated
*/ */
brackets?: any; 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?: { docComment?: {
scope: string; scope: string;
open: string; open: string;
...@@ -2511,7 +2517,7 @@ declare namespace vscode { ...@@ -2511,7 +2517,7 @@ declare namespace vscode {
/** /**
* **Deprecated** Do not use. * **Deprecated** Do not use.
* *
* @deprecated Use the language configuration file instead. * @deprecated * Use the the autoClosingPairs property in the language configuration file instead.
*/ */
__characterPairSupport?: { __characterPairSupport?: {
autoClosingPairs: { autoClosingPairs: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册