From a3261162de3a7bc2932ad5f89792a928712941df Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 6 Jun 2023 18:35:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=94=89,=20=E5=8F=88=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E5=A0=86=E6=B2=A1=E5=95=A5=E7=94=A8=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 31 ++---- src/main.js | 7 +- syntaxes/es6.inline.css.json | 16 ++-- syntaxes/es6.inline.html.json | 16 ++-- syntaxes/es6.inline.scss.json | 172 ++-------------------------------- tests/index.js | 2 + 6 files changed, 35 insertions(+), 209 deletions(-) diff --git a/package.json b/package.json index 70474e9..6a0bdb8 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,7 @@ ], "activationEvents": [ "onLanguage:javascript", - "onLanguage:typescript", - "onLanguage:javascriptreact", - "onLanguage:typescriptreact" + "onLanguage:javascriptreact" ], "main": "./dist/main.js", "contributes": { @@ -47,50 +45,35 @@ "grammars": [ { "injectTo": [ - "source.js", - "source.js.jsx", - "source.jsx", - "source.ts", - "source.ts.tsx", - "source.tsx" + "source.js" ], "scopeName": "es6.inline.html", "path": "./syntaxes/es6.inline.html.json", "embeddedLanguages": { "meta.embedded.block.html": "html", - "meta.template.expression.ts": "typescript" + "meta.template.expression.js": "javascript" } }, { "injectTo": [ - "source.js", - "source.js.jsx", - "source.jsx", - "source.ts", - "source.ts.tsx", - "source.tsx" + "source.js" ], "scopeName": "es6.inline.css", "path": "./syntaxes/es6.inline.css.json", "embeddedLanguages": { "meta.embedded.block.css": "css", - "meta.template.expression.ts": "typescript" + "meta.template.expression.js": "javascript" } }, { "injectTo": [ - "source.js", - "source.js.jsx", - "source.jsx", - "source.ts", - "source.ts.tsx", - "source.tsx" + "source.js" ], "scopeName": "es6.inline.scss", "path": "./syntaxes/es6.inline.scss.json", "embeddedLanguages": { "meta.embedded.block.css": "scss", - "meta.template.expression.ts": "typescript" + "meta.template.expression.js": "javascript" } } ] diff --git a/src/main.js b/src/main.js index b25adef..3aad605 100644 --- a/src/main.js +++ b/src/main.js @@ -6,12 +6,7 @@ import { } from './providers/css.js' import { HTMLHoverProvider, CSSHoverProvider } from './providers/hover.js' import { CodeFormatterProvider } from './providers/formatting.js' -const selector = [ - 'typescriptreact', - 'javascriptreact', - 'typescript', - 'javascript' -] +const selector = ['javascriptreact', 'javascript'] export function activate(Context) { new CodeFormatterProvider() diff --git a/syntaxes/es6.inline.css.json b/syntaxes/es6.inline.css.json index f9fe55f..82e4a81 100644 --- a/syntaxes/es6.inline.css.json +++ b/syntaxes/es6.inline.css.json @@ -1,28 +1,28 @@ { "scopeName": "es6.inline.css", - "fileTypes": ["js", "jsx", "ts", "tsx"], - "injectionSelector": "L:source.js -comment -string, L:source.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string", + "fileTypes": ["js"], + "injectionSelector": "L:source.js -comment -string", "patterns": [ { "contentName": "meta.embedded.block.css", - "begin": "(?x)(\\s*?(\\w+\\.)?(?:css)\\s*)(`)", + "begin": "(?i)(\\s*css)(`)", "beginCaptures": { "0": { - "name": "string.template.ts, punctuation.definition.string.template.begin.ts" + "name": "string.template.js, punctuation.definition.string.template.begin.js" }, "1": { - "name": "entity.name.function.tagged-template.ts" + "name": "entity.name.function.tagged-template.js" } }, "end": "(`)", "endCaptures": { "0": { - "name": "string.template.ts, punctuation.definition.string.template.end.ts" + "name": "string.template.js, punctuation.definition.string.template.end.js" } }, "patterns": [ { - "include": "source.ts#template-substitution-element" + "include": "source.js#template-substitution-element" }, { "include": "source.css.scss" @@ -30,7 +30,7 @@ ] }, { - "include": "source.ts#template-substitution-element" + "include": "source.js#template-substitution-element" } ] } diff --git a/syntaxes/es6.inline.html.json b/syntaxes/es6.inline.html.json index 7a7d438..0183cba 100644 --- a/syntaxes/es6.inline.html.json +++ b/syntaxes/es6.inline.html.json @@ -1,7 +1,7 @@ { "scopeName": "es6.inline.html", - "fileTypes": ["js", "jsx", "ts", "tsx"], - "injectionSelector": "L:source.js -comment -string, L:source.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string", + "fileTypes": ["js"], + "injectionSelector": "L:source.js -comment -string", "injections": { "L:source": { "patterns": [ @@ -15,24 +15,24 @@ "patterns": [ { "contentName": "meta.embedded.block.html", - "begin": "(?x)(\\s*?(\\w+\\.)?(?:html)\\s*)(`)", + "begin": "(?i)(\\s*html)(`)", "beginCaptures": { "0": { - "name": "string.template.ts, punctuation.definition.string.template.begin.ts" + "name": "string.template.js, punctuation.definition.string.template.begin.js" }, "1": { - "name": "entity.name.function.tagged-template.ts" + "name": "entity.name.function.tagged-template.js" } }, "end": "(`)", "endCaptures": { "0": { - "name": "string.template.ts, punctuation.definition.string.template.end.ts" + "name": "string.template.js, punctuation.definition.string.template.end.js" } }, "patterns": [ { - "include": "source.ts#template-substitution-element" + "include": "source.js#template-substitution-element" }, { "include": "text.html.basic" @@ -40,7 +40,7 @@ ] }, { - "include": "source.ts#template-substitution-element" + "include": "source.js#template-substitution-element" } ] } diff --git a/syntaxes/es6.inline.scss.json b/syntaxes/es6.inline.scss.json index 94e4683..1d9391d 100644 --- a/syntaxes/es6.inline.scss.json +++ b/syntaxes/es6.inline.scss.json @@ -1,28 +1,28 @@ { "scopeName": "es6.inline.scss", - "fileTypes": ["js", "jsx", "ts", "tsx"], - "injectionSelector": "L:source.js -comment -string, L:source.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string", + "fileTypes": ["js"], + "injectionSelector": "L:source.js -comment -string", "patterns": [ { "contentName": "meta.embedded.block.css", - "begin": "(?x)(\\s*?(\\w+\\.)?(?:scss)\\s*)(`)", + "begin": "(?i)(\\s*scss)(`)", "beginCaptures": { "0": { - "name": "string.template.ts, punctuation.definition.string.template.begin.ts" + "name": "string.template.js, punctuation.definition.string.template.begin.js" }, "1": { - "name": "entity.name.function.tagged-template.ts" + "name": "entity.name.function.tagged-template.js" } }, "end": "(`)", "endCaptures": { "0": { - "name": "string.template.ts, punctuation.definition.string.template.end.ts" + "name": "string.template.js, punctuation.definition.string.template.end.js" } }, "patterns": [ { - "include": "source.ts#template-substitution-element" + "include": "source.js#template-substitution-element" }, { "include": "source.css.scss" @@ -30,161 +30,7 @@ ] }, { - "include": "source.ts#template-substitution-element" + "include": "source.js#template-substitution-element" } - ], - "repository": { - "reserved-words": { - "name": "support.type.property-name.css.postcss", - "match": "\\b(false|from|in|not|null|through|to|true)\\b" - }, - "double-quoted": { - "patterns": [ - { - "include": "#quoted-interpolation" - } - ], - "begin": "\"", - "name": "string.quoted.double.css.postcss", - "end": "\"" - }, - "operator": { - "name": "keyword.operator.postcss", - "match": "\\+|\\s-\\s|\\s-(?=\\$)|(?<=\\()-(?=\\$)|\\s-(?=\\()|\\*|/|%|=|!|<|>|~" - }, - "function-content": { - "name": "string.quoted.double.css.postcss", - "match": "(?<=url\\(|format\\(|attr\\().+?(?=\\))" - }, - "double-slash": { - "patterns": [ - { - "include": "#comment-tag" - } - ], - "begin": "//", - "name": "comment.line.postcss", - "end": "$" - }, - "numeric": { - "name": "constant.numeric.css.postcss", - "match": "(-|\\.)?[0-9]+(\\.[0-9]+)?" - }, - "variable-root-css": { - "name": "variable.parameter.postcss", - "match": "(?