From 62090918dd647448784542b548d8b26091d4af85 Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 16 Mar 2022 15:21:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtsx,=20jsx=E7=9A=84=E7=9D=80?= =?UTF-8?q?=E8=89=B2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ data/logs/out.log | 14 ++++++++++++++ package.json | 18 +++++++++++++++--- src/es.js | 38 +++++++++++++++++++++++++++++++++++--- themes/color-theme.json | 21 ++++++++++++++++++--- 5 files changed, 84 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d921bd..1eb579c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # 更新日志 +## [1.6.3] 2022-03-16 +- 修复jsx, tsx着色问题 ## [1.6.2] 2022-03-14 - 修复js字符串模板中的着色 diff --git a/data/logs/out.log b/data/logs/out.log index 4e24608..a57a78c 100644 --- a/data/logs/out.log +++ b/data/logs/out.log @@ -31,3 +31,17 @@ Build complete... Build complete... Build complete... Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... diff --git a/package.json b/package.json index 3eaa7e2..a2c1322 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,15 @@ "displayName": "one plain", "description": "🔥 米白色主题", "icon": "logo.png", - "version": "1.6.2", + "version": "1.6.3", "publisher": "yutent", "author": "Yutent [@yutent]", "engines": { "vscode": "^1.29.0" }, - "categories": ["Themes"], + "categories": [ + "Themes" + ], "repository": { "type": "git", "url": "https://github.com/yutent/one-plain.git" @@ -23,6 +25,16 @@ } ] }, - "keywords": ["theme", "one", "plain", "one plain", "mi", "color", "light", "one-plain", "yutent"], + "keywords": [ + "theme", + "one", + "plain", + "one plain", + "mi", + "color", + "light", + "one-plain", + "yutent" + ], "license": "MIT" } diff --git a/src/es.js b/src/es.js index a4e6b9c..6753cc1 100644 --- a/src/es.js +++ b/src/es.js @@ -5,7 +5,9 @@ module.exports = [ name: 'import constant', scope: [ 'meta.import.js variable.other.readwrite.alias.js', - 'meta.import.ts variable.other.readwrite.alias.ts' + 'meta.import.jsx variable.other.readwrite.alias.jsx', + 'meta.import.ts variable.other.readwrite.alias.ts', + 'meta.import.tsx variable.other.readwrite.alias.tsx' ], settings: { foreground: vars.blue2 @@ -16,8 +18,12 @@ module.exports = [ scope: [ 'meta.import.js string.quoted.single.js', 'meta.import.js string.quoted.double.js', + 'meta.import.jsx string.quoted.single.jsx', + 'meta.import.jsx string.quoted.double.jsx', 'meta.import.ts string.quoted.single.ts', - 'meta.import.ts string.quoted.double.ts' + 'meta.import.ts string.quoted.double.ts', + 'meta.import.tsx string.quoted.single.tsx', + 'meta.import.tsx string.quoted.double.tsx' ], settings: { fontStyle: 'underline', @@ -135,7 +141,15 @@ module.exports = [ 'string.template.js meta.template.expression.js meta.array.literal.js meta.brace.square.js', 'string.template.js meta.template.expression.js meta.brace.round.js', 'string.template.ts meta.template.expression.ts meta.array.literal.ts meta.brace.square.ts', - 'string.template.ts meta.template.expression.ts meta.brace.round.ts' + 'string.template.ts meta.template.expression.ts meta.brace.round.ts', + 'meta.tag.attributes.jsx punctuation.section.embedded.begin.jsx', + 'meta.tag.attributes.jsx punctuation.section.embedded.end.jsx', + 'meta.tag.without-attributes.jsx punctuation.section.embedded.begin.jsx', + 'meta.tag.without-attributes.jsx punctuation.section.embedded.end.jsx', + 'meta.tag.attributes.tsx punctuation.section.embedded.begin.tsx', + 'meta.tag.attributes.tsx punctuation.section.embedded.end.tsx', + 'meta.tag.without-attributes.tsx punctuation.section.embedded.begin.tsx', + 'meta.tag.without-attributes.tsx punctuation.section.embedded.end.tsx' ], settings: { foreground: vars.common @@ -223,5 +237,23 @@ module.exports = [ fontStyle: 'italic bold', foreground: vars.common } + }, + { + name: 'jsx Tag', + scope: [ + 'entity.name.tag.jsx support.class.component.jsx', + 'entity.name.tag.tsx support.class.component.tsx' + ], + settings: { + fontStyle: 'normal', + foreground: '#FF5370' + } + }, + { + name: 'Tag Content String', + scope: ['meta.tag.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx'], + settings: { + foreground: '#546e7a' + } } ] diff --git a/themes/color-theme.json b/themes/color-theme.json index dadcf6f..c6893b1 100644 --- a/themes/color-theme.json +++ b/themes/color-theme.json @@ -491,14 +491,14 @@ }, { "name": "import constant", - "scope": "meta.import.js variable.other.readwrite.alias.js, meta.import.ts variable.other.readwrite.alias.ts", + "scope": "meta.import.js variable.other.readwrite.alias.js, meta.import.jsx variable.other.readwrite.alias.jsx, meta.import.ts variable.other.readwrite.alias.ts, meta.import.tsx variable.other.readwrite.alias.tsx", "settings": { "foreground": "#0096ff" } }, { "name": "import path", - "scope": "meta.import.js string.quoted.single.js, meta.import.js string.quoted.double.js, meta.import.ts string.quoted.single.ts, meta.import.ts string.quoted.double.ts", + "scope": "meta.import.js string.quoted.single.js, meta.import.js string.quoted.double.js, meta.import.jsx string.quoted.single.jsx, meta.import.jsx string.quoted.double.jsx, meta.import.ts string.quoted.single.ts, meta.import.ts string.quoted.double.ts, meta.import.tsx string.quoted.single.tsx, meta.import.tsx string.quoted.double.tsx", "settings": { "fontStyle": "underline", "foreground": "#90a4ae" @@ -575,7 +575,7 @@ }, { "name": "Punctuation", - "scope": "meta.object.member.js meta.array.literal.js meta.brace.square.js, meta.object.member.js meta.arrow.js meta.brace.round.js, string.template.js meta.template.expression.js meta.array.literal.js meta.brace.square.js, string.template.js meta.template.expression.js meta.brace.round.js, string.template.ts meta.template.expression.ts meta.array.literal.ts meta.brace.square.ts, string.template.ts meta.template.expression.ts meta.brace.round.ts", + "scope": "meta.object.member.js meta.array.literal.js meta.brace.square.js, meta.object.member.js meta.arrow.js meta.brace.round.js, string.template.js meta.template.expression.js meta.array.literal.js meta.brace.square.js, string.template.js meta.template.expression.js meta.brace.round.js, string.template.ts meta.template.expression.ts meta.array.literal.ts meta.brace.square.ts, string.template.ts meta.template.expression.ts meta.brace.round.ts, meta.tag.attributes.jsx punctuation.section.embedded.begin.jsx, meta.tag.attributes.jsx punctuation.section.embedded.end.jsx, meta.tag.without-attributes.jsx punctuation.section.embedded.begin.jsx, meta.tag.without-attributes.jsx punctuation.section.embedded.end.jsx, meta.tag.attributes.tsx punctuation.section.embedded.begin.tsx, meta.tag.attributes.tsx punctuation.section.embedded.end.tsx, meta.tag.without-attributes.tsx punctuation.section.embedded.begin.tsx, meta.tag.without-attributes.tsx punctuation.section.embedded.end.tsx", "settings": { "foreground": "#90a4ae" } @@ -626,6 +626,21 @@ "foreground": "#90a4ae" } }, + { + "name": "jsx Tag", + "scope": "entity.name.tag.jsx support.class.component.jsx, entity.name.tag.tsx support.class.component.tsx", + "settings": { + "fontStyle": "normal", + "foreground": "#FF5370" + } + }, + { + "name": "Tag Content String", + "scope": "meta.tag.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx", + "settings": { + "foreground": "#546e7a" + } + }, { "name": "PHP Constants", "scope": "constant.other.php, support.constant.ext.php, support.constant.std.php,support.constant.core.php, support.constant.parser-token.php, constant",