From a1af8aa65122361621ba538fad84bb98f4d98a12 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Mon, 17 May 2021 09:12:01 +0200 Subject: [PATCH 1/2] Refactors calls to languages.setLanguageConfiguration to declarative descriptions in language-configuration.json. This fixes #98621. --- .../client/src/cssClient.ts | 20 -------- extensions/css/language-configuration.json | 7 ++- .../handlebars/language-configuration.json | 21 ++++++++- .../client/src/htmlClient.ts | 37 +-------------- .../client/src/htmlEmptyTagsShared.ts | 6 --- extensions/html/language-configuration.json | 25 +++++++++- .../client/src/jsonClient.ts | 13 +----- extensions/json/language-configuration.json | 7 ++- extensions/less/language-configuration.json | 13 +++--- .../language-configuration.json | 3 +- .../src/extension.ts | 5 -- .../php-language-features/src/phpMain.ts | 35 +------------- extensions/php/language-configuration.json | 46 ++++++++++++++++++- extensions/scss/language-configuration.json | 9 +++- 14 files changed, 120 insertions(+), 127 deletions(-) delete mode 100644 extensions/html-language-features/client/src/htmlEmptyTagsShared.ts diff --git a/extensions/css-language-features/client/src/cssClient.ts b/extensions/css-language-features/client/src/cssClient.ts index 4bfa95c8439..de53a8821f3 100644 --- a/extensions/css-language-features/client/src/cssClient.ts +++ b/extensions/css-language-features/client/src/cssClient.ts @@ -92,26 +92,6 @@ export function startClient(context: ExtensionContext, newLanguageClient: Langua // client can be deactivated on extension deactivation context.subscriptions.push(disposable); - let indentationRules = { - increaseIndentPattern: /(^.*\{[^}]*$)/, - decreaseIndentPattern: /^\s*\}/ - }; - - languages.setLanguageConfiguration('css', { - wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\w-?]+%?|[@#!.])/g, - indentationRules: indentationRules - }); - - languages.setLanguageConfiguration('less', { - wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]+(?=[^,{;]*[,{]))|(([@#.!])?[\w-?]+%?|[@#!.])/g, - indentationRules: indentationRules - }); - - languages.setLanguageConfiguration('scss', { - wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]*(?=[^,{;]*[,{]))|(([@$#.!])?[\w-?]+%?|[@#!$.])/g, - indentationRules: indentationRules - }); - client.onReady().then(() => { context.subscriptions.push(initCompletionProvider()); }); diff --git a/extensions/css/language-configuration.json b/extensions/css/language-configuration.json index bd3151ea17e..6ce9919abeb 100644 --- a/extensions/css/language-configuration.json +++ b/extensions/css/language-configuration.json @@ -26,5 +26,10 @@ "start": "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/", "end": "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/" } - } + }, + "indentationRules": { + "increaseIndentPattern": "(^.*\\{[^}]*$)", + "decreaseIndentPattern": "^\\s*\\}" + }, + "wordPattern": { "pattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])", "flags": "g" } } diff --git a/extensions/handlebars/language-configuration.json b/extensions/handlebars/language-configuration.json index cb2de742fb0..103024366b2 100644 --- a/extensions/handlebars/language-configuration.json +++ b/extensions/handlebars/language-configuration.json @@ -22,5 +22,24 @@ { "open": "\"", "close": "\"" }, { "open": "<", "close": ">" }, { "open": "{", "close": "}" } - ] + ], + "wordPattern": { + "pattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)", + "flags": "g" + }, + "onEnterRules": [ + { + "beforeText": { "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!\\/)>)[^<]*$", "flags": "i" }, + "afterText": { "pattern": "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>", "flags": "i" }, + "action": { + "indent": "indentOutdent" + } + }, + { + "beforeText": { "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))(\\w[\\w\\d]*)([^/>]*(?!\\/)>)[^<]*$", "flags": "i" }, + "action": { + "indent": "indent" + } + } + ], } diff --git a/extensions/html-language-features/client/src/htmlClient.ts b/extensions/html-language-features/client/src/htmlClient.ts index 2c6e911910c..af9ba15253b 100644 --- a/extensions/html-language-features/client/src/htmlClient.ts +++ b/extensions/html-language-features/client/src/htmlClient.ts @@ -7,7 +7,7 @@ import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); import { - languages, ExtensionContext, IndentAction, Position, TextDocument, Range, CompletionItem, CompletionItemKind, SnippetString, workspace, extensions, + languages, ExtensionContext, Position, TextDocument, Range, CompletionItem, CompletionItemKind, SnippetString, workspace, extensions, Disposable, FormattingOptions, CancellationToken, ProviderResult, TextEdit, CompletionContext, CompletionList, SemanticTokensLegend, DocumentSemanticTokensProvider, DocumentRangeSemanticTokensProvider, SemanticTokens, window, commands } from 'vscode'; @@ -15,7 +15,6 @@ import { LanguageClientOptions, RequestType, TextDocumentPositionParams, DocumentRangeFormattingParams, DocumentRangeFormattingRequest, ProvideCompletionItemsSignature, TextDocumentIdentifier, RequestType0, Range as LspRange, NotificationType, CommonLanguageClient } from 'vscode-languageclient'; -import { EMPTY_ELEMENTS } from './htmlEmptyTagsShared'; import { activateTagClosing } from './tagClosing'; import { RequestService } from './requests'; import { getCustomDataSource } from './customData'; @@ -197,40 +196,6 @@ export function startClient(context: ExtensionContext, newLanguageClient: Langua } } - languages.setLanguageConfiguration('html', { - indentationRules: { - increaseIndentPattern: /<(?!\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr)\b|[^>]*\/>)([-_\.A-Za-z0-9]+)(?=\s|>)\b[^>]*>(?!.*<\/\1>)|)|\{[^}"']*$/, - decreaseIndentPattern: /^\s*(<\/(?!html)[-_\.A-Za-z0-9]+\b[^>]*>|-->|\})/ - }, - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g, - onEnterRules: [ - { - beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'), - afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>/i, - action: { indentAction: IndentAction.IndentOutdent } - }, - { - beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'), - action: { indentAction: IndentAction.Indent } - } - ], - }); - - languages.setLanguageConfiguration('handlebars', { - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g, - onEnterRules: [ - { - beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'), - afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>/i, - action: { indentAction: IndentAction.IndentOutdent } - }, - { - beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'), - action: { indentAction: IndentAction.Indent } - } - ], - }); - const regionCompletionRegExpr = /^(\s*)(<(!(-(-\s*(#\w*)?)?)?)?)?$/; const htmlSnippetCompletionRegExpr = /^(\s*)(<(h(t(m(l)?)?)?)?)?$/; languages.registerCompletionItemProvider(documentSelector, { diff --git a/extensions/html-language-features/client/src/htmlEmptyTagsShared.ts b/extensions/html-language-features/client/src/htmlEmptyTagsShared.ts deleted file mode 100644 index 872b3880aba..00000000000 --- a/extensions/html-language-features/client/src/htmlEmptyTagsShared.ts +++ /dev/null @@ -1,6 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -export const EMPTY_ELEMENTS: string[] = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr']; diff --git a/extensions/html/language-configuration.json b/extensions/html/language-configuration.json index 191f54303f1..215d7df1f2f 100644 --- a/extensions/html/language-configuration.json +++ b/extensions/html/language-configuration.json @@ -29,5 +29,28 @@ "start": "^\\s*", "end": "^\\s*" } + }, + "wordPattern": { + "pattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)", + "flags": "g" + }, + "onEnterRules": [ + { + "beforeText": { "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!\\/)>)[^<]*$", "flags": "i" }, + "afterText": { "pattern": "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>", "flags": "i" }, + "action": { + "indent": "indentOutdent" + } + }, + { + "beforeText": { "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))(\\w[\\w\\d]*)([^/>]*(?!\\/)>)[^<]*$", "flags": "i" }, + "action": { + "indent": "indent" + } + } + ], + "indentationRules": { + "increaseIndentPattern": "<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr)\\b|[^>]*\\/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*<\\/\\1>)|)|\\{[^}\"']*$", + "decreaseIndentPattern": "^\\s*(<\\/(?!html)[-_\\.A-Za-z0-9]+\\b[^>]*>|-->|\\})" } -} \ No newline at end of file +} diff --git a/extensions/json-language-features/client/src/jsonClient.ts b/extensions/json-language-features/client/src/jsonClient.ts index c925a9181f6..0725370dd28 100644 --- a/extensions/json-language-features/client/src/jsonClient.ts +++ b/extensions/json-language-features/client/src/jsonClient.ts @@ -7,7 +7,7 @@ import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); import { - workspace, window, languages, commands, ExtensionContext, extensions, Uri, LanguageConfiguration, + workspace, window, languages, commands, ExtensionContext, extensions, Uri, Diagnostic, StatusBarAlignment, TextEditor, TextDocument, FormattingOptions, CancellationToken, ProviderResult, TextEdit, Range, Position, Disposable, CompletionItem, CompletionList, CompletionContext, Hover, MarkdownString, } from 'vscode'; @@ -362,17 +362,6 @@ export function startClient(context: ExtensionContext, newLanguageClient: Langua } }); - - const languageConfiguration: LanguageConfiguration = { - wordPattern: /("(?:[^\\\"]*(?:\\.)?)*"?)|[^\s{}\[\],:]+/, - indentationRules: { - increaseIndentPattern: /({+(?=([^"]*"[^"]*")*[^"}]*$))|(\[+(?=([^"]*"[^"]*")*[^"\]]*$))/, - decreaseIndentPattern: /^\s*[}\]],?\s*$/ - } - }; - languages.setLanguageConfiguration('json', languageConfiguration); - languages.setLanguageConfiguration('jsonc', languageConfiguration); - } function getSchemaAssociations(_context: ExtensionContext): ISchemaAssociation[] { diff --git a/extensions/json/language-configuration.json b/extensions/json/language-configuration.json index 7faa70cef7a..8f270cd2b24 100644 --- a/extensions/json/language-configuration.json +++ b/extensions/json/language-configuration.json @@ -14,5 +14,10 @@ { "open": "'", "close": "'", "notIn": ["string"] }, { "open": "\"", "close": "\"", "notIn": ["string", "comment"] }, { "open": "`", "close": "`", "notIn": ["string", "comment"] } - ] + ], + "wordPattern": "(\"(?:[^\\\\\\\"]*(?:\\\\.)?)*\"?)|[^\\s{}\\[\\],:]+", + "indentationRules": { + "increaseIndentPattern": "({+(?=([^\"]*\"[^\"]*\")*[^\"}]*$))|(\\[+(?=([^\"]*\"[^\"]*\")*[^\"\\]]*$))", + "decreaseIndentPattern": "^\\s*[}\\]],?\\s*$" + } } diff --git a/extensions/less/language-configuration.json b/extensions/less/language-configuration.json index 181954633b0..a75adf4edb1 100644 --- a/extensions/less/language-configuration.json +++ b/extensions/less/language-configuration.json @@ -22,14 +22,15 @@ ["\"", "\""], ["'", "'"] ], - "indentationRules": { - "increaseIndentPattern": "(^.*\\{[^}]*$)", - "decreaseIndentPattern": "^\\s*\\}" - }, "folding": { "markers": { "start": "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/", "end": "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/" } - } -} \ No newline at end of file + }, + "indentationRules": { + "increaseIndentPattern": "(^.*\\{[^}]*$)", + "decreaseIndentPattern": "^\\s*\\}" + }, + "wordPattern": { "pattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]+(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])", "flags": "g" } +} diff --git a/extensions/markdown-basics/language-configuration.json b/extensions/markdown-basics/language-configuration.json index 7dade386d01..d5d64a80ae5 100644 --- a/extensions/markdown-basics/language-configuration.json +++ b/extensions/markdown-basics/language-configuration.json @@ -49,5 +49,6 @@ "start": "^\\s*", "end": "^\\s*" } - } + }, + "wordPattern": { "pattern": "(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})(((\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})|[_])?(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark}))*", "flags": "ug" }, } diff --git a/extensions/markdown-language-features/src/extension.ts b/extensions/markdown-language-features/src/extension.ts index 0bce318ae7e..a3479c6cd77 100644 --- a/extensions/markdown-language-features/src/extension.ts +++ b/extensions/markdown-language-features/src/extension.ts @@ -52,12 +52,7 @@ function registerMarkdownLanguageFeatures( ): vscode.Disposable { const selector: vscode.DocumentSelector = { language: 'markdown', scheme: '*' }; - const charPattern = '(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})'; - return vscode.Disposable.from( - vscode.languages.setLanguageConfiguration('markdown', { - wordPattern: new RegExp(`${charPattern}((${charPattern}|[_])?${charPattern})*`, 'ug'), - }), vscode.languages.registerDocumentSymbolProvider(selector, symbolProvider), vscode.languages.registerDocumentLinkProvider(selector, new LinkProvider()), vscode.languages.registerFoldingRangeProvider(selector, new MarkdownFoldingProvider(engine)), diff --git a/extensions/php-language-features/src/phpMain.ts b/extensions/php-language-features/src/phpMain.ts index d3179e1ed9f..1ce7fa0fb76 100644 --- a/extensions/php-language-features/src/phpMain.ts +++ b/extensions/php-language-features/src/phpMain.ts @@ -19,37 +19,4 @@ export function activate(context: vscode.ExtensionContext): any { context.subscriptions.push(vscode.languages.registerCompletionItemProvider('php', new PHPCompletionItemProvider(), '>', '$')); context.subscriptions.push(vscode.languages.registerHoverProvider('php', new PHPHoverProvider())); context.subscriptions.push(vscode.languages.registerSignatureHelpProvider('php', new PHPSignatureHelpProvider(), '(', ',')); - - // need to set in the extension host as well as the completion provider uses it. - vscode.languages.setLanguageConfiguration('php', { - wordPattern: /(-?\d*\.\d\w*)|([^\-\`\~\!\@\#\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, - onEnterRules: [ - { - // e.g. /** | */ - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - afterText: /^\s*\*\/$/, - action: { indentAction: vscode.IndentAction.IndentOutdent, appendText: ' * ' } - }, - { - // e.g. /** ...| - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - action: { indentAction: vscode.IndentAction.None, appendText: ' * ' } - }, - { - // e.g. * ...| - beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/, - action: { indentAction: vscode.IndentAction.None, appendText: '* ' } - }, - { - // e.g. */| - beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/, - action: { indentAction: vscode.IndentAction.None, removeText: 1 } - }, - { - // e.g. *-----*/| - beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/, - action: { indentAction: vscode.IndentAction.None, removeText: 1 } - } - ] - }); -} \ No newline at end of file +} diff --git a/extensions/php/language-configuration.json b/extensions/php/language-configuration.json index b785c0092ab..7a430e45f7f 100644 --- a/extensions/php/language-configuration.json +++ b/extensions/php/language-configuration.json @@ -33,5 +33,49 @@ "start": "^\\s*(#|\/\/)region\\b", "end": "^\\s*(#|\/\/)endregion\\b" } - } + }, + "wordPattern": { "pattern": "(-?\\d*\\.\\d\\w*)|([^\\-\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)", "flags": "g" }, + "onEnterRules": [ + { + // e.g. /** | */ + "beforeText": "^\\s*\\/\\*\\*(?!\\/)([^\\*]|\\*(?!\\/))*$", + "afterText": "^\\s*\\*\\/$", + "action": { + "indent": "indentOutdent", + "appendText": " * " + } + }, + { + // e.g. /** ...| + "beforeText": "^\\s*\\/\\*\\*(?!\\/)([^\\*]|\\*(?!\\/))*$", + "action": { + "indent": "none", + "appendText": " * " + } + }, + { + // e.g. * ...| + "beforeText": "^(\\t|(\\ \\ ))*\\ \\*(\\ ([^\\*]|\\*(?!\\/))*)?$", + "action": { + "indent": "none", + "appendText": "* ", + }, + }, + { + // e.g. */| + "beforeText": "^(\\t|(\\ \\ ))*\\ \\*\\/\\s*$", + "action": { + "indent": "none", + "removeText": 1 + }, + }, + { + // e.g. *-----*/| + "beforeText": "^(\\t|(\\ \\ ))*\\ \\*[^/]*\\*\\/\\s*$", + "action": { + "indent": "none", + "removeText": 1 + } + } + ] } diff --git a/extensions/scss/language-configuration.json b/extensions/scss/language-configuration.json index bdf0984ec18..30a751fd77f 100644 --- a/extensions/scss/language-configuration.json +++ b/extensions/scss/language-configuration.json @@ -27,5 +27,10 @@ "start": "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/", "end": "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/" } - } -} \ No newline at end of file + }, + "indentationRules": { + "increaseIndentPattern": "(^.*\\{[^}]*$)", + "decreaseIndentPattern": "^\\s*\\}" + }, + "wordPattern": { "pattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@$#.!])?[\\w-?]+%?|[@#!$.])", "flags": "g" } +} From dcf81c62656ccfd908e91fc7e6a1121fddf2dfd4 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Mon, 31 May 2021 19:47:57 +0200 Subject: [PATCH 2/2] Removes g flag from wordPatterns. --- extensions/css/language-configuration.json | 2 +- extensions/handlebars/language-configuration.json | 5 +---- extensions/html/language-configuration.json | 5 +---- extensions/less/language-configuration.json | 2 +- extensions/php/language-configuration.json | 2 +- extensions/scss/language-configuration.json | 2 +- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/extensions/css/language-configuration.json b/extensions/css/language-configuration.json index 6ce9919abeb..83dbabd8760 100644 --- a/extensions/css/language-configuration.json +++ b/extensions/css/language-configuration.json @@ -31,5 +31,5 @@ "increaseIndentPattern": "(^.*\\{[^}]*$)", "decreaseIndentPattern": "^\\s*\\}" }, - "wordPattern": { "pattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])", "flags": "g" } + "wordPattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])" } diff --git a/extensions/handlebars/language-configuration.json b/extensions/handlebars/language-configuration.json index 103024366b2..e132410dd29 100644 --- a/extensions/handlebars/language-configuration.json +++ b/extensions/handlebars/language-configuration.json @@ -23,10 +23,7 @@ { "open": "<", "close": ">" }, { "open": "{", "close": "}" } ], - "wordPattern": { - "pattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)", - "flags": "g" - }, + "wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)", "onEnterRules": [ { "beforeText": { "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!\\/)>)[^<]*$", "flags": "i" }, diff --git a/extensions/html/language-configuration.json b/extensions/html/language-configuration.json index 215d7df1f2f..51e103a6926 100644 --- a/extensions/html/language-configuration.json +++ b/extensions/html/language-configuration.json @@ -30,10 +30,7 @@ "end": "^\\s*" } }, - "wordPattern": { - "pattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)", - "flags": "g" - }, + "wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)", "onEnterRules": [ { "beforeText": { "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!\\/)>)[^<]*$", "flags": "i" }, diff --git a/extensions/less/language-configuration.json b/extensions/less/language-configuration.json index a75adf4edb1..7325d052704 100644 --- a/extensions/less/language-configuration.json +++ b/extensions/less/language-configuration.json @@ -32,5 +32,5 @@ "increaseIndentPattern": "(^.*\\{[^}]*$)", "decreaseIndentPattern": "^\\s*\\}" }, - "wordPattern": { "pattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]+(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])", "flags": "g" } + "wordPattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]+(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])" } diff --git a/extensions/php/language-configuration.json b/extensions/php/language-configuration.json index 7a430e45f7f..e585ebf1c91 100644 --- a/extensions/php/language-configuration.json +++ b/extensions/php/language-configuration.json @@ -34,7 +34,7 @@ "end": "^\\s*(#|\/\/)endregion\\b" } }, - "wordPattern": { "pattern": "(-?\\d*\\.\\d\\w*)|([^\\-\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)", "flags": "g" }, + "wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\-\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)", "onEnterRules": [ { // e.g. /** | */ diff --git a/extensions/scss/language-configuration.json b/extensions/scss/language-configuration.json index 30a751fd77f..8ed82ad4a6c 100644 --- a/extensions/scss/language-configuration.json +++ b/extensions/scss/language-configuration.json @@ -32,5 +32,5 @@ "increaseIndentPattern": "(^.*\\{[^}]*$)", "decreaseIndentPattern": "^\\s*\\}" }, - "wordPattern": { "pattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@$#.!])?[\\w-?]+%?|[@#!$.])", "flags": "g" } + "wordPattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@$#.!])?[\\w-?]+%?|[@#!$.])" }