From bce6fe83afb8bd0cafb7b7e194cc8f0143a51594 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Sat, 19 Sep 2020 01:28:33 +0200 Subject: [PATCH] Define `printWidth` at 100 --- .prettierrc | 3 +- scripts/bundle.js | 15 +-- src/_.contribution.ts | 4 +- src/abap/abap.ts | 10 +- src/apex/apex.test.ts | 6 +- src/apex/apex.ts | 13 +-- src/azcli/azcli.test.ts | 13 +-- src/bat/bat.ts | 5 +- src/clojure/clojure.test.ts | 5 +- src/coffee/coffee.test.ts | 3 +- src/cpp/cpp.ts | 17 +-- src/csharp/csharp.test.ts | 6 +- src/csharp/csharp.ts | 11 +- src/css/css.ts | 44 ++------ src/dart/dart.ts | 21 +--- src/dockerfile/dockerfile.test.ts | 3 +- src/dockerfile/dockerfile.ts | 5 +- src/fsharp/fsharp.ts | 8 +- src/graphql/graphql.test.ts | 3 +- src/graphql/graphql.ts | 15 +-- src/handlebars/handlebars.test.ts | 3 +- src/handlebars/handlebars.ts | 63 +++-------- src/html/html.contribution.ts | 19 +--- src/html/html.test.ts | 3 +- src/html/html.ts | 43 ++----- src/java/java.test.ts | 3 +- src/java/java.ts | 13 +-- src/javascript/javascript.ts | 5 +- src/julia/julia.ts | 10 +- src/kotlin/kotlin.test.ts | 3 +- src/kotlin/kotlin.ts | 13 +-- src/less/less.test.ts | 15 +-- src/less/less.ts | 16 +-- src/lexon/lexon.test.ts | 3 +- src/lexon/lexon.ts | 10 +- src/lua/lua.ts | 10 +- src/markdown/markdown.contribution.ts | 11 +- src/markdown/markdown.ts | 25 +---- src/mips/mips.test.ts | 3 +- src/mocha.d.ts | 5 +- src/mysql/mysql.ts | 4 +- src/perl/perl.ts | 106 ++++-------------- src/pgsql/pgsql.ts | 4 +- src/php/php.test.ts | 3 +- src/php/php.ts | 72 +++--------- src/postiats/postiats.test.ts | 3 +- src/postiats/postiats.ts | 5 +- src/powerquery/powerquery.ts | 5 +- src/pug/pug.test.ts | 3 +- src/pug/pug.ts | 32 +----- src/r/r.ts | 13 +-- src/razor/razor.ts | 85 +++----------- src/redis/redis.test.ts | 3 +- src/redshift/redshift.ts | 4 +- src/restructuredtext/restructuredtext.test.ts | 6 +- src/restructuredtext/restructuredtext.ts | 51 ++------- src/ruby/ruby.ts | 97 +++------------- src/rust/rust.ts | 10 +- src/sb/sb.ts | 15 +-- src/scala/scala.contribution.ts | 7 +- src/scala/scala.test.ts | 3 +- src/scala/scala.ts | 103 ++++------------- src/scss/scss.test.ts | 27 +---- src/scss/scss.ts | 53 ++------- src/sql/sql.test.ts | 3 +- src/st/st.ts | 10 +- src/swift/swift.test.ts | 3 +- src/systemverilog/systemverilog.test.ts | 6 +- src/systemverilog/systemverilog.ts | 30 +---- src/tcl/tcl.ts | 20 +--- src/test/testRunner.ts | 11 +- src/tsconfig.esm.json | 8 +- src/tsconfig.json | 8 +- src/twig/twig.test.ts | 3 +- src/twig/twig.ts | 48 ++------ src/typescript/typescript.ts | 21 +--- src/xml/xml.contribution.ts | 7 +- src/xml/xml.test.ts | 15 +-- src/xml/xml.ts | 27 +---- src/yaml/yaml.ts | 18 +-- test/all.js | 8 +- 81 files changed, 290 insertions(+), 1156 deletions(-) diff --git a/.prettierrc b/.prettierrc index e1b5c6fc..c12f08c5 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,5 +3,6 @@ "singleQuote": true, "trailingComma": "none", "semi": true, - "useTabs": true + "useTabs": true, + "printWidth": 100 } diff --git a/scripts/bundle.js b/scripts/bundle.js index 0d8aa9e8..a02c3348 100644 --- a/scripts/bundle.js +++ b/scripts/bundle.js @@ -22,10 +22,7 @@ const BUNDLED_FILE_HEADER = [ ].join('\n'); bundleOne('monaco.contribution'); -glob('out/amd/*/*.contribution.js', { cwd: path.dirname(__dirname) }, function ( - err, - files -) { +glob('out/amd/*/*.contribution.js', { cwd: path.dirname(__dirname) }, function (err, files) { if (err) { console.log(err); return; @@ -52,14 +49,8 @@ function bundleOne(moduleId, exclude) { optimize: 'none' }, async function (buildResponse) { - const devFilePath = path.join( - REPO_ROOT, - 'release/dev/' + moduleId + '.js' - ); - const minFilePath = path.join( - REPO_ROOT, - 'release/min/' + moduleId + '.js' - ); + const devFilePath = path.join(REPO_ROOT, 'release/dev/' + moduleId + '.js'); + const minFilePath = path.join(REPO_ROOT, 'release/min/' + moduleId + '.js'); const fileContents = fs.readFileSync(devFilePath).toString(); console.log(); console.log(`Minifying ${devFilePath}...`); diff --git a/src/_.contribution.ts b/src/_.contribution.ts index 1593a990..41092f88 100644 --- a/src/_.contribution.ts +++ b/src/_.contribution.ts @@ -20,9 +20,7 @@ const lazyLanguageLoaders: { [languageId: string]: LazyLanguageLoader } = {}; class LazyLanguageLoader { public static getOrCreate(languageId: string): LazyLanguageLoader { if (!lazyLanguageLoaders[languageId]) { - lazyLanguageLoaders[languageId] = new LazyLanguageLoader( - languageId - ); + lazyLanguageLoaders[languageId] = new LazyLanguageLoader(languageId); } return lazyLanguageLoaders[languageId]; } diff --git a/src/abap/abap.ts b/src/abap/abap.ts index 83687940..eb61ad7f 100644 --- a/src/abap/abap.ts +++ b/src/abap/abap.ts @@ -499,17 +499,11 @@ export const language = { [/[:,.]/, 'delimiter'], [/[{}()\[\]]/, '@brackets'], - [ - /@symbols/, - { cases: { '@operators': 'operator', '@default': '' } } - ], + [/@symbols/, { cases: { '@operators': 'operator', '@default': '' } }], [/'/, { token: 'string', bracket: '@open', next: '@stringquote' }], [/`/, { token: 'string', bracket: '@open', next: '@stringping' }], - [ - /\|/, - { token: 'string', bracket: '@open', next: '@stringtemplate' } - ], + [/\|/, { token: 'string', bracket: '@open', next: '@stringtemplate' }], [/\d+/, 'number'] ], diff --git a/src/apex/apex.test.ts b/src/apex/apex.test.ts index 63346bfd..a683d991 100644 --- a/src/apex/apex.test.ts +++ b/src/apex/apex.test.ts @@ -233,8 +233,7 @@ testTokenization('apex', [ // Keywords [ { - line: - 'package test; class Program { static void main(String[] args) {} } }', + line: 'package test; class Program { static void main(String[] args) {} } }', tokens: [ { startIndex: 0, type: 'keyword.package.apex' }, { startIndex: 7, type: '' }, @@ -271,8 +270,7 @@ testTokenization('apex', [ // Keywords with case variations [ { - line: - 'Package test; CLASS Program { Static void main(String[] args) {} } }', + line: 'Package test; CLASS Program { Static void main(String[] args) {} } }', tokens: [ { startIndex: 0, type: 'keyword.Package.apex' }, { startIndex: 7, type: '' }, diff --git a/src/apex/apex.ts b/src/apex/apex.ts index 546f188e..1ebed5bb 100644 --- a/src/apex/apex.ts +++ b/src/apex/apex.ts @@ -34,12 +34,8 @@ export const conf: languages.LanguageConfiguration = { ], folding: { markers: { - start: new RegExp( - '^\\s*//\\s*(?:(?:#?region\\b)|(?:))' - ) + start: new RegExp('^\\s*//\\s*(?:(?:#?region\\b)|(?:))') } } }; @@ -300,10 +296,7 @@ export const language = { // numbers [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, 'number.float'], - [ - /(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, - 'number.float' - ], + [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, 'number.float'], [/(@digits)[fFdD]/, 'number.float'], [/(@digits)[lL]?/, 'number'], diff --git a/src/azcli/azcli.test.ts b/src/azcli/azcli.test.ts index 0b104e9e..cf34ecfd 100644 --- a/src/azcli/azcli.test.ts +++ b/src/azcli/azcli.test.ts @@ -3,15 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { - testTokenization as actualTestTokenization, - ITestItem -} from '../test/testRunner'; +import { testTokenization as actualTestTokenization, ITestItem } from '../test/testRunner'; -function testTokenization( - _language: string | string[], - tests: ITestItem[][] -): void { +function testTokenization(_language: string | string[], tests: ITestItem[][]): void { tests = tests.map((t) => { return t.map((t) => { return { @@ -93,8 +87,7 @@ testTokenization('azcli', [ ], [ { - line: - 'az ad sp create-for-rb --name ServicePrincipalName --password PASSWORD', + line: 'az ad sp create-for-rb --name ServicePrincipalName --password PASSWORD', tokens: [ { startIndex: 0, type: 'keyword.azcli' }, { startIndex: 23, type: 'key.identifier.azcli' }, diff --git a/src/bat/bat.ts b/src/bat/bat.ts index 0d8e5421..7b316dae 100644 --- a/src/bat/bat.ts +++ b/src/bat/bat.ts @@ -55,10 +55,7 @@ export const language = { root: [ [/^(\s*)(rem(?:\s.*|))$/, ['', 'comment']], - [ - /(\@?)(@keywords)(?!\w)/, - [{ token: 'keyword' }, { token: 'keyword.$2' }] - ], + [/(\@?)(@keywords)(?!\w)/, [{ token: 'keyword' }, { token: 'keyword.$2' }]], // whitespace [/[ \t\r\n]+/, ''], diff --git a/src/clojure/clojure.test.ts b/src/clojure/clojure.test.ts index 0ec297f1..4046eeb3 100644 --- a/src/clojure/clojure.test.ts +++ b/src/clojure/clojure.test.ts @@ -864,10 +864,7 @@ testTokenization('clojure', [ ], // comments - createTestCases( - ['; this is an in-line comment.', ';; this is a line comment.'], - 'comment' - ), + createTestCases(['; this is an in-line comment.', ';; this is a line comment.'], 'comment'), // `comment` [ diff --git a/src/coffee/coffee.test.ts b/src/coffee/coffee.test.ts index ef821a9d..2f09b03c 100644 --- a/src/coffee/coffee.test.ts +++ b/src/coffee/coffee.test.ts @@ -1694,8 +1694,7 @@ testTokenization('coffeescript', [ tokens: [{ startIndex: 0, type: '' }] }, { - line: - '# Everything is an Expression (at least, as much as possible)', + line: '# Everything is an Expression (at least, as much as possible)', tokens: [{ startIndex: 0, type: 'comment.coffee' }] }, { diff --git a/src/cpp/cpp.ts b/src/cpp/cpp.ts index 013f033b..0e0bc737 100644 --- a/src/cpp/cpp.ts +++ b/src/cpp/cpp.ts @@ -281,10 +281,7 @@ export const language = { tokenizer: { root: [ // C++ 11 Raw String - [ - /@encoding?R\"(?:([^ ()\\\t]*))\(/, - { token: 'string.raw.begin', next: '@raw.$1' } - ], + [/@encoding?R\"(?:([^ ()\\\t]*))\(/, { token: 'string.raw.begin', next: '@raw.$1' }], // identifiers and keywords [ @@ -303,10 +300,7 @@ export const language = { // [[ attributes ]]. [/\[\[.*\]\]/, 'annotation'], - [ - /^\s*#include/, - { token: 'keyword.directive.include', next: '@include' } - ], + [/^\s*#include/, { token: 'keyword.directive.include', next: '@include' }], // Preprocessor directive [/^\s*#\s*\w+/, 'keyword'], @@ -383,12 +377,7 @@ export const language = { 'string.raw.end', { token: 'string.raw.end', next: '@pop' } ], - '@default': [ - 'string.raw', - 'string.raw', - 'string.raw', - 'string.raw' - ] + '@default': ['string.raw', 'string.raw', 'string.raw', 'string.raw'] } } ], diff --git a/src/csharp/csharp.test.ts b/src/csharp/csharp.test.ts index 6e9b0c56..9b1aaae7 100644 --- a/src/csharp/csharp.test.ts +++ b/src/csharp/csharp.test.ts @@ -205,8 +205,7 @@ testTokenization('csharp', [ tokens: [{ startIndex: 0, type: '' }] }, { - line: - ' string someString = $"hello{outside+variable}the string again {{ escaped";', + line: ' string someString = $"hello{outside+variable}the string again {{ escaped";', tokens: [ { startIndex: 0, type: '' }, { startIndex: 3, type: 'keyword.string.cs' }, @@ -425,8 +424,7 @@ testTokenization('csharp', [ // Keywords [ { - line: - 'namespace VS { class Program { static void Main(string[] args) {} } }', + line: 'namespace VS { class Program { static void Main(string[] args) {} } }', tokens: [ { startIndex: 0, type: 'keyword.namespace.cs' }, { startIndex: 9, type: '' }, diff --git a/src/csharp/csharp.ts b/src/csharp/csharp.ts index 5f4a2985..8a10da21 100644 --- a/src/csharp/csharp.ts +++ b/src/csharp/csharp.ts @@ -163,16 +163,7 @@ export const language = { namespaceFollows: ['namespace', 'using'], - parenFollows: [ - 'if', - 'for', - 'while', - 'switch', - 'foreach', - 'using', - 'catch', - 'when' - ], + parenFollows: ['if', 'for', 'while', 'switch', 'foreach', 'using', 'catch', 'when'], operators: [ '=', diff --git a/src/css/css.ts b/src/css/css.ts index a2d32916..05bd2445 100644 --- a/src/css/css.ts +++ b/src/css/css.ts @@ -69,23 +69,14 @@ export const language = { { token: 'keyword', next: '@keyframedeclaration' } ], ['[@](page|content|font-face|-moz-document)', { token: 'keyword' }], - [ - '[@](charset|namespace)', - { token: 'keyword', next: '@declarationbody' } - ], + ['[@](charset|namespace)', { token: 'keyword', next: '@declarationbody' }], [ '(url-prefix)(\\()', - [ - 'attribute.value', - { token: 'delimiter.parenthesis', next: '@urldeclaration' } - ] + ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] ], [ '(url)(\\()', - [ - 'attribute.value', - { token: 'delimiter.parenthesis', next: '@urldeclaration' } - ] + ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] ], { include: '@selectorname' }, ['[\\*]', 'tag'], // selector symbols @@ -96,11 +87,7 @@ export const language = { selectorbody: [ { include: '@comments' }, - [ - '[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))', - 'attribute.name', - '@rulevalue' - ], // rule definition: to distinguish from a nested selector check for whitespace, number or a semicolon + ['[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))', 'attribute.name', '@rulevalue'], // rule definition: to distinguish from a nested selector check for whitespace, number or a semicolon ['}', { token: 'delimiter.bracket', next: '@pop' }] ], @@ -117,17 +104,11 @@ export const language = { { include: '@comments' }, [ '(url-prefix)(\\()', - [ - 'attribute.value', - { token: 'delimiter.parenthesis', next: '@urldeclaration' } - ] + ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] ], [ '(url)(\\()', - [ - 'attribute.value', - { token: 'delimiter.parenthesis', next: '@urldeclaration' } - ] + ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] ], { include: '@functioninvocation' }, { include: '@numbers' }, @@ -145,13 +126,9 @@ export const language = { ['(?=})', { token: '', next: '@pop' }] // missing semicolon ], - warndebug: [ - ['[@](warn|debug)', { token: 'keyword', next: '@declarationbody' }] - ], + warndebug: [['[@](warn|debug)', { token: 'keyword', next: '@declarationbody' }]], - import: [ - ['[@](import)', { token: 'keyword', next: '@declarationbody' }] - ], + import: [['[@](import)', { token: 'keyword', next: '@declarationbody' }]], urldeclaration: [ { include: '@strings' }, @@ -211,10 +188,7 @@ export const language = { ], functioninvocation: [ - [ - '@identifier\\(', - { token: 'attribute.value', next: '@functionarguments' } - ] + ['@identifier\\(', { token: 'attribute.value', next: '@functionarguments' }] ], functionarguments: [ diff --git a/src/dart/dart.ts b/src/dart/dart.ts index bf62aa0e..ed19512f 100644 --- a/src/dart/dart.ts +++ b/src/dart/dart.ts @@ -255,23 +255,13 @@ export const language = { regexp: [ [ /(\{)(\d+(?:,\d*)?)(\})/, - [ - 'regexp.escape.control', - 'regexp.escape.control', - 'regexp.escape.control' - ] + ['regexp.escape.control', 'regexp.escape.control', 'regexp.escape.control'] ], [ /(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/, - [ - 'regexp.escape.control', - { token: 'regexp.escape.control', next: '@regexrange' } - ] - ], - [ - /(\()(\?:|\?=|\?!)/, - ['regexp.escape.control', 'regexp.escape.control'] + ['regexp.escape.control', { token: 'regexp.escape.control', next: '@regexrange' }] ], + [/(\()(\?:|\?=|\?!)/, ['regexp.escape.control', 'regexp.escape.control']], [/[()]/, 'regexp.escape.control'], [/@regexpctl/, 'regexp.escape.control'], [/[^\\\/]/, 'regexp'], @@ -279,10 +269,7 @@ export const language = { [/\\\./, 'regexp.invalid'], [ /(\/)([gimsuy]*)/, - [ - { token: 'regexp', bracket: '@close', next: '@pop' }, - 'keyword.other' - ] + [{ token: 'regexp', bracket: '@close', next: '@pop' }, 'keyword.other'] ] ], diff --git a/src/dockerfile/dockerfile.test.ts b/src/dockerfile/dockerfile.test.ts index 1c1c7ca1..847d17f5 100644 --- a/src/dockerfile/dockerfile.test.ts +++ b/src/dockerfile/dockerfile.test.ts @@ -146,8 +146,7 @@ testTokenization('dockerfile', [ ] }, { - line: - ' && sh autogen.sh && ./configure && make && make install \\', + line: ' && sh autogen.sh && ./configure && make && make install \\', tokens: [{ startIndex: 0, type: '' }] }, { diff --git a/src/dockerfile/dockerfile.ts b/src/dockerfile/dockerfile.ts index c21d5aa4..ed59327b 100644 --- a/src/dockerfile/dockerfile.ts +++ b/src/dockerfile/dockerfile.ts @@ -39,10 +39,7 @@ export const language = { { include: '@comment' }, [/(ONBUILD)(\s+)/, ['keyword', '']], - [ - /(ENV)(\s+)([\w]+)/, - ['keyword', '', { token: 'variable', next: '@arguments' }] - ], + [/(ENV)(\s+)([\w]+)/, ['keyword', '', { token: 'variable', next: '@arguments' }]], [ /(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/, { token: 'keyword', next: '@arguments' } diff --git a/src/fsharp/fsharp.ts b/src/fsharp/fsharp.ts index bac126b9..2b6ea177 100644 --- a/src/fsharp/fsharp.ts +++ b/src/fsharp/fsharp.ts @@ -30,12 +30,8 @@ export const conf: languages.LanguageConfiguration = { ], folding: { markers: { - start: new RegExp( - '^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)' - ), - end: new RegExp( - '^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)' - ) + start: new RegExp('^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)'), + end: new RegExp('^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)') } } }; diff --git a/src/graphql/graphql.test.ts b/src/graphql/graphql.test.ts index 3b65e8ac..56c33047 100644 --- a/src/graphql/graphql.test.ts +++ b/src/graphql/graphql.test.ts @@ -21,8 +21,7 @@ testTokenization('graphql', [ // Root schema definition [ { - line: - 'schema { query: Query, mutation: Mutation subscription: Subscription }', + line: 'schema { query: Query, mutation: Mutation subscription: Subscription }', tokens: [ { startIndex: 0, type: 'keyword.gql' }, { startIndex: 6, type: '' }, diff --git a/src/graphql/graphql.ts b/src/graphql/graphql.ts index 93d662fa..a96b93e8 100644 --- a/src/graphql/graphql.ts +++ b/src/graphql/graphql.ts @@ -132,18 +132,12 @@ export const language = { // delimiters and operators [/[{}()\[\]]/, '@brackets'], - [ - /@symbols/, - { cases: { '@operators': 'operator', '@default': '' } } - ], + [/@symbols/, { cases: { '@operators': 'operator', '@default': '' } }], // @ annotations. // As an example, we emit a debugging log message on these tokens. // Note: message are supressed during the first load -- change some lines to see them. - [ - /@\s*[a-zA-Z_\$][\w\$]*/, - { token: 'annotation', log: 'annotation token: $0' } - ], + [/@\s*[a-zA-Z_\$][\w\$]*/, { token: 'annotation', log: 'annotation token: $0' }], // numbers [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], @@ -153,10 +147,7 @@ export const language = { // delimiter: after number because of .\d floats [/[;,.]/, 'delimiter'], - [ - /"""/, - { token: 'string', next: '@mlstring', nextEmbedded: 'markdown' } - ], + [/"""/, { token: 'string', next: '@mlstring', nextEmbedded: 'markdown' }], // strings [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string diff --git a/src/handlebars/handlebars.test.ts b/src/handlebars/handlebars.test.ts index 5a67ca05..75a087d0 100644 --- a/src/handlebars/handlebars.test.ts +++ b/src/handlebars/handlebars.test.ts @@ -173,8 +173,7 @@ testTokenization( // HTML Expressions [ { - line: - '', + line: '', tokens: [ { startIndex: 0, type: 'delimiter.html' }, { startIndex: 1, type: 'tag.html' }, diff --git a/src/handlebars/handlebars.ts b/src/handlebars/handlebars.ts index ff0a630d..92bb81a7 100644 --- a/src/handlebars/handlebars.ts +++ b/src/handlebars/handlebars.ts @@ -56,9 +56,7 @@ export const conf: languages.LanguageConfiguration = { onEnterRules: [ { beforeText: new RegExp( - `<(?!(?:${EMPTY_ELEMENTS.join( - '|' - )}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, + `<(?!(?:${EMPTY_ELEMENTS.join('|')}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i' ), afterText: /^<\/(\w[\w\d]*)\s*>$/i, @@ -68,9 +66,7 @@ export const conf: languages.LanguageConfiguration = { }, { beforeText: new RegExp( - `<(?!(?:${EMPTY_ELEMENTS.join( - '|' - )}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, + `<(?!(?:${EMPTY_ELEMENTS.join('|')}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i' ), action: { indentAction: languages.IndentAction.Indent } @@ -88,29 +84,14 @@ export const language = { root: [ [/\{\{!--/, 'comment.block.start.handlebars', '@commentBlock'], [/\{\{!/, 'comment.start.handlebars', '@comment'], - [ - /\{\{/, - { token: '@rematch', switchTo: '@handlebarsInSimpleState.root' } - ], + [/\{\{/, { token: '@rematch', switchTo: '@handlebarsInSimpleState.root' }], [/)/, ['delimiter.html', 'tag.html', 'delimiter.html']], - [ - /(<)(script)/, - ['delimiter.html', { token: 'tag.html', next: '@script' }] - ], - [ - /(<)(style)/, - ['delimiter.html', { token: 'tag.html', next: '@style' }] - ], - [ - /(<)([:\w]+)/, - ['delimiter.html', { token: 'tag.html', next: '@otherTag' }] - ], - [ - /(<\/)(\w+)/, - ['delimiter.html', { token: 'tag.html', next: '@otherTag' }] - ], + [/(<)(script)/, ['delimiter.html', { token: 'tag.html', next: '@script' }]], + [/(<)(style)/, ['delimiter.html', { token: 'tag.html', next: '@style' }]], + [/(<)([:\w]+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]], + [/(<\/)(\w+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]], [/{ [/[ \t\r\n]+/], // whitespace [ /(<\/)(script\s*)(>)/, - [ - 'delimiter.html', - 'tag.html', - { token: 'delimiter.html', next: '@pop' } - ] + ['delimiter.html', 'tag.html', { token: 'delimiter.html', next: '@pop' }] ] ], @@ -265,8 +242,7 @@ export const language = { /\{\{/, { token: '@rematch', - switchTo: - '@handlebarsInSimpleState.scriptWithCustomType.$S2' + switchTo: '@handlebarsInSimpleState.scriptWithCustomType.$S2' } ], [ @@ -294,10 +270,7 @@ export const language = { nextEmbedded: '@pop' } ], - [ - /<\/script/, - { token: '@rematch', next: '@pop', nextEmbedded: '@pop' } - ] + [/<\/script/, { token: '@rematch', next: '@pop', nextEmbedded: '@pop' }] ], // -- END