优化ts/js/md/php的代码高亮

pull/6/head 1.2.0
宇天 2018-12-06 16:27:50 +08:00
parent 0c310bcea9
commit a967cd4dc2
12 changed files with 336 additions and 309 deletions

View File

@ -1,6 +1,10 @@
# 更新日志
## [1.2.0] 2018-12-06
- 优化ts/js/md/php的代码高亮
## [1.1.1] 2018-12-03
- 一点小细节调整

View File

@ -5,8 +5,10 @@
## 安装(Installation)
> 直接从插件管理器搜索"米白"下载即可。
> 直接从插件管理器搜索`米白`下载即可。
> 想看我的所有的插件,可以搜索 `yutent`
## 问题(Issue)
> 有任何问题,或建议, 都可以到[GitHub](https://github.com/yutent/one-plain.git) 提出。

View File

@ -15,9 +15,9 @@ const base = require('./src/base')
const es = require('./src/es')
const php = require('./src/php')
const html = require('./src/html')
const markdown = require('./src/markdown')
const plaintext = require('./src/plaintext')
const json = require('./src/json')
const tokenColors = [].concat(base, html, es, php, markdown, json)
const tokenColors = [].concat(base, html, es, php, plaintext, json)
for (let it of tokenColors) {
if (Array.isArray(it.scope)) {

View File

@ -3,7 +3,7 @@
"displayName": "米白色主题",
"description": "🔥 米白色主题",
"icon": "logo.png",
"version": "1.1.1",
"version": "1.2.0",
"publisher": "yutent",
"author": "Yutent [@yutent]",
"engines": {

View File

@ -114,28 +114,28 @@ module.exports = [
'meta.block-level'
],
settings: {
foreground: '#0099ff'
foreground: vars.blue2
}
},
{
name: 'C-related Block Level Variables',
scope: ['source.cpp meta.block variable.other'],
settings: {
foreground: '#FF5370'
foreground: '#ff5370'
}
},
{
name: 'Variables constant',
scope: ['variable.other.constant'],
settings: {
foreground: '#FF5370'
foreground: vars.red1
}
},
{
name: 'Other Variable, String Link',
scope: ['support.other.variable', 'string.other.link'],
settings: {
foreground: '#FF5370'
foreground: '#ff5370'
}
},
{
@ -191,30 +191,29 @@ module.exports = [
}
},
{
name: 'Symbols, Inherited Class, Markup Heading',
name: 'Symbols',
scope: [
'constant.other.symbol',
'constant.other.key',
'entity.other.inherited-class',
'markup.heading',
'markup.inserted.git_gutter',
'meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js'
'meta.group.braces.curly',
'constant.other.object.key.js',
'string.unquoted.label.js'
],
settings: {
foreground: vars.common2
}
},
{
name: 'Class, Support',
name: 'Class, Support, inherited-class',
scope: [
'entity.name.class',
'entity.name.type.class',
'entity.other.inherited-class',
'support.type',
'support.class',
'support.orther.namespace.use.php',
'meta.use.php',
'support.other.namespace.php',
'markup.changed.git_gutter',
'support.type.sys-types'
],
settings: {
@ -245,13 +244,9 @@ module.exports = [
},
{
name: 'Sub-methods',
scope: [
'entity.name.module.js',
'variable.import.parameter.js',
'variable.other.class.js'
],
scope: ['entity.name.module.js', 'variable.import.parameter.js'],
settings: {
foreground: '#E53935'
foreground: '#e53935'
}
},
{
@ -259,7 +254,7 @@ module.exports = [
scope: ['variable.language'],
settings: {
fontStyle: 'italic',
foreground: '#E53935'
foreground: '#e53935'
}
},
{

View File

@ -8,11 +8,11 @@ module.exports = {
'progressBar.background': '#80CBC4',
'textLink.foreground': '#80CBC4',
'textLink.activeForeground': vars.common,
'editorCursor.foreground': vars.dark,
'editorCursor.foreground': vars.dark2,
'editorRuler.foreground': '#B0BEC5',
'editorLineNumber.foreground': '#CFD8DC',
'editorLineNumber.activeForeground': '#627883',
'editorBracketMatch.border': vars.dark + 50,
'editorBracketMatch.border': vars.dark2 + 50,
'editorBracketMatch.background': vars.white,
'editorWhitespace.foreground': vars.plain2,
'editor.background': vars.white,
@ -105,7 +105,7 @@ module.exports = {
'terminal.ansiRed': vars.red2,
'terminal.ansiYellow': vars.yellow2,
'terminal.ansiBrightWhite': vars.grey1,
'terminal.ansiBrightBlack': vars.dark,
'terminal.ansiBrightBlack': vars.dark2,
'terminal.ansiBrightBlue': vars.blue1,
'terminal.ansiBrightCyan': vars.cyan1,
'terminal.ansiBrightGreen': vars.green1,

View File

@ -1,3 +1,5 @@
const vars = require('./var')
module.exports = [
{
name: 'ES7 Bind Operator',
@ -7,6 +9,31 @@ module.exports = [
foreground: '#E53935'
}
},
{
name: 'Class extends, console',
scope: [
'support.type.object.console.js',
'support.type.object.module.js',
'support.constant.math',
// 'support.type.object.module',
'meta.class.extends.js > variable.other.readwrite.js'
],
settings: {
fontStyle: 'bold italic',
foreground: '#ffb62c'
}
},
{
name: 'new Class',
scope: ['new.expr entity.name.type'],
settings: {
fontStyle: 'bold',
foreground: '#ffb62c'
}
},
{
name: 'js/ts italic',
scope: [
@ -21,19 +48,15 @@ module.exports = [
},
{
name: 'math js/ts',
scope: 'support.constant.math',
name: 'Build-in props',
scope: [
'meta.group.braces.round variable.other.constant',
'support.type.object.module keyword.operator.accessor',
'support.constant.property.math.ts'
],
settings: {
foreground: '#ffb62c',
fontStyle: 'bold italic'
}
},
{
name: 'math property js/ts',
scope: 'support.constant.property.math',
settings: {
foreground: '#7c4dff'
fontStyle: 'italic bold',
foreground: vars.blue2
}
},
@ -49,7 +72,7 @@ module.exports = [
'entity.name.type'
],
settings: {
foreground: '#E5C07B',
foreground: '#e5c07b',
fontStyle: 'bold'
}
}

View File

@ -25,68 +25,5 @@ module.exports = [
settings: {
foreground: '#6182B8'
}
},
{
name: 'Markup - Italic',
scope: ['markup.italic'],
settings: {
fontStyle: 'italic',
foreground: '#FF5370'
}
},
{
name: 'Markup - Bold',
scope: ['markup.bold', 'markup.bold string'],
settings: {
fontStyle: 'bold',
foreground: '#FF5370'
}
},
{
name: 'Markup - Bold-Italic',
scope: [
'markup.bold markup.italic',
'markup.italic markup.bold',
'markup.quote markup.bold',
'markup.bold markup.italic string',
'markup.italic markup.bold string',
'markup.quote markup.bold string'
],
settings: {
fontStyle: 'bold',
foreground: '#FF5370'
}
},
{
name: 'Markup - Underline',
scope: ['markup.underline'],
settings: {
fontStyle: 'underline',
foreground: '#F76D47'
}
},
{
name: 'Markup - Quote',
scope: ['markup.quote'],
settings: {
fontStyle: 'italic'
}
},
{
name: 'Markup - Raw Block',
scope: ['markup.raw.block'],
settings: {
foreground: '#7C4DFF'
}
},
{
name: 'Markup - Table',
scope: ['markup.table'],
settings: {
foreground: '#90A4AE'
}
}
]

View File

@ -1,92 +0,0 @@
module.exports = [
{
name: 'Markdown - Plain',
scope: ['text.html.markdown', 'punctuation.definition.list_item.markdown'],
settings: {
foreground: '#90A4AE'
}
},
{
name: 'Markdown - Markup Raw Inline',
scope: ['text.html.markdown markup.inline.raw.markdown'],
settings: {
foreground: '#7C4DFF'
}
},
{
name: 'Markdown - Markup Raw Inline Punctuation',
scope: [
'text.html.markdown markup.inline.raw.markdown punctuation.definition.raw.markdown'
],
settings: {
foreground: '#E7EAEC'
}
},
{
name: 'Markdown - Heading',
scope: [
'markdown.heading',
'markup.heading | markup.heading entity.name',
'markup.heading.markdown punctuation.definition.heading.markdown'
],
settings: {
foreground: '#91B859'
}
},
{
name: 'Markdown - Blockquote',
scope: ['markup.quote punctuation.definition.blockquote.markdown'],
settings: {
foreground: '#E7EAEC'
}
},
{
name: 'Markdown - Link',
scope: ['string.other.link.title.markdown'],
settings: {
foreground: '#6182B8'
}
},
{
name: 'Markdown - Link Description',
scope: ['string.other.link.description.title.markdown'],
settings: {
foreground: '#7C4DFF'
}
},
{
name: 'Markdown - Link Anchor',
scope: ['constant.other.reference.link.markdown'],
settings: {
foreground: '#FFB62C'
}
},
{
name: 'Markdown - Fenced Bode Block Variable',
scope: [
'markup.fenced_code.block.markdown',
'markup.inline.raw.string.markdown'
],
settings: {
foreground: '#90A4AE'
}
},
{
name: 'Markdown - Fenced Language',
scope: ['variable.language.fenced.markdown'],
settings: {
foreground: '#E7EAEC'
}
},
{
name: 'Markdown - Separator',
scope: ['meta.separator'],
settings: {
fontStyle: 'bold',
foreground: '#E7EAEC'
}
}
]

156
src/plaintext.js Normal file
View File

@ -0,0 +1,156 @@
const vars = require('./var')
module.exports = [
{
name: 'Markdown - Plain',
scope: ['text.html.markdown', 'punctuation.definition.list_item.markdown'],
settings: {
foreground: vars.common2
}
},
{
name: 'inline code',
scope: ['markup.inline'],
settings: {
foreground: '#ff5370'
}
},
{
name: 'Bode Block',
scope: ['markup.fenced_code.block.markdown', 'markup.raw.block'],
settings: {
foreground: vars.common
}
},
{
name: 'Markdown - Heading',
scope: [
'markdown.heading',
'markup.heading',
'markup.heading entity.name',
'markup.heading.markdown',
'punctuation.definition.heading.markdown'
],
settings: {
foreground: vars.red1,
fontStyle: 'bold'
}
},
{
name: 'Markdown - Blockquote',
scope: ['markup.quote'],
settings: {
fontStyle: 'italic',
foreground: vars.common
}
},
{
name: 'link & image',
scope: [
'markup.underline.link.image.markdown',
'markup.underline.link.markdown'
],
settings: {
fontStyle: 'italic',
foreground: vars.grey2
}
},
{
name: 'link text & image text',
scope: [
'string.other.link.title.markdown',
'string.other.link.description.markdown'
],
settings: {
fontStyle: '',
foreground: vars.blue2
}
},
{
name: 'Markdown - Fenced Language',
scope: ['variable.language.fenced.markdown'],
settings: {
foreground: '#E7EAEC'
}
},
{
name: 'Markdown - Separator',
scope: ['meta.separator'],
settings: {
fontStyle: 'bold',
foreground: '#E7EAEC'
}
},
{
name: 'Markup - Italic',
scope: ['markup.italic'],
settings: {
fontStyle: 'italic',
foreground: vars.grey2
}
},
{
name: 'Markup - Bold',
scope: ['markup.bold', 'markup.bold string'],
settings: {
fontStyle: 'bold',
foreground: vars.dark1
}
},
{
name: 'Markup - Bold-Italic',
scope: ['markup.bold markup.italic', 'markup.italic markup.bold'],
settings: {
fontStyle: 'bold italic',
foreground: vars.dark1
}
},
{
name: 'delete & insert & underline',
scope: ['markup.inserted', 'markup.deleted', 'markup.underline'],
settings: {
fontStyle: 'underline',
foreground: vars.common
}
},
{
name: 'underline',
scope: ['markup.underline'],
settings: {
foreground: vars.red1
}
},
{
name: 'order list & unorder list',
scope: ['markup.list'],
settings: {
foreground: vars.dark2,
fontStyle: 'bold'
}
},
{
name: 'all md sign',
scope: [
'punctuation.definition.markdown',
'punctuation.definition.list.begin.markdown',
'punctuation.definition.heading.markdown',
'punctuation.definition.quote.begin.markdown',
'punctuation.definition.italic.markdown',
'punctuation.definition.bold.markdown',
'punctuation.definition.italic.markdown'
],
settings: {
fontStyle: '',
foreground: vars.grey1
}
}
]

View File

@ -4,12 +4,13 @@ module.exports = {
transparent: '#ffffff00',
black: '#000000',
white: '#ffffff',
dark: '#272727',
dark1: '#75797b',
dark2: '#35373b',
plain1: '#f7f8fb',
plain2: '#f3f5fb',
plain3: '#e7e8eb',
grey1: '#ebebeb',
grey2: '#c0c0c0',
grey1: '#c7c8cb',
grey2: '#b3b5ab',
blue1: '#70acf7',
blue2: '#0096ff',
cyan1: '#3fc2a7',

View File

@ -9,11 +9,11 @@
"progressBar.background": "#80CBC4",
"textLink.foreground": "#80CBC4",
"textLink.activeForeground": "#90a4ae",
"editorCursor.foreground": "#272727",
"editorCursor.foreground": "#35373b",
"editorRuler.foreground": "#B0BEC5",
"editorLineNumber.foreground": "#CFD8DC",
"editorLineNumber.activeForeground": "#627883",
"editorBracketMatch.border": "#27272750",
"editorBracketMatch.border": "#35373b50",
"editorBracketMatch.background": "#ffffff",
"editorWhitespace.foreground": "#f3f5fb",
"editor.background": "#ffffff",
@ -97,7 +97,7 @@
"list.focusBackground": "#90A4AE20",
"list.focusForeground": "#90a4ae",
"list.highlightForeground": "#80CBC4",
"terminal.ansiWhite": "#c0c0c0",
"terminal.ansiWhite": "#b3b5ab",
"terminal.ansiBlack": "#000000",
"terminal.ansiBlue": "#0096ff",
"terminal.ansiCyan": "#19b491",
@ -105,8 +105,8 @@
"terminal.ansiMagenta": "#9437ff",
"terminal.ansiRed": "#ea4224",
"terminal.ansiYellow": "#e67e22",
"terminal.ansiBrightWhite": "#ebebeb",
"terminal.ansiBrightBlack": "#272727",
"terminal.ansiBrightWhite": "#c7c8cb",
"terminal.ansiBrightBlack": "#35373b",
"terminal.ansiBrightBlue": "#70acf7",
"terminal.ansiBrightCyan": "#3fc2a7",
"terminal.ansiBrightGreen": "#2ecc71",
@ -265,28 +265,28 @@
"name": "Function, Special Method, Block Level",
"scope": "entity.name.function, meta.function-call, variable.function, support.function, keyword.other.special-method, meta.block-level",
"settings": {
"foreground": "#0099ff"
"foreground": "#0096ff"
}
},
{
"name": "C-related Block Level Variables",
"scope": "source.cpp meta.block variable.other",
"settings": {
"foreground": "#FF5370"
"foreground": "#ff5370"
}
},
{
"name": "Variables constant",
"scope": "variable.other.constant",
"settings": {
"foreground": "#FF5370"
"foreground": "#ff4628"
}
},
{
"name": "Other Variable, String Link",
"scope": "support.other.variable, string.other.link",
"settings": {
"foreground": "#FF5370"
"foreground": "#ff5370"
}
},
{
@ -335,15 +335,15 @@
}
},
{
"name": "Symbols, Inherited Class, Markup Heading",
"scope": "constant.other.symbol, constant.other.key, entity.other.inherited-class, markup.heading, markup.inserted.git_gutter, meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js",
"name": "Symbols",
"scope": "constant.other.symbol, constant.other.key, meta.group.braces.curly, constant.other.object.key.js, string.unquoted.label.js",
"settings": {
"foreground": "#546e7a"
}
},
{
"name": "Class, Support",
"scope": "entity.name.class, entity.name.type.class, support.type, support.class, support.orther.namespace.use.php, meta.use.php, support.other.namespace.php, markup.changed.git_gutter, support.type.sys-types",
"name": "Class, Support, inherited-class",
"scope": "entity.name.class, entity.name.type.class, entity.other.inherited-class, support.type, support.class, support.orther.namespace.use.php, meta.use.php, support.other.namespace.php, support.type.sys-types",
"settings": {
"fontStyle": "bold italic",
"foreground": "#FFB62C"
@ -365,9 +365,9 @@
},
{
"name": "Sub-methods",
"scope": "entity.name.module.js, variable.import.parameter.js, variable.other.class.js",
"scope": "entity.name.module.js, variable.import.parameter.js",
"settings": {
"foreground": "#E53935"
"foreground": "#e53935"
}
},
{
@ -375,7 +375,7 @@
"scope": "variable.language",
"settings": {
"fontStyle": "italic",
"foreground": "#E53935"
"foreground": "#e53935"
}
},
{
@ -472,59 +472,6 @@
"foreground": "#6182B8"
}
},
{
"name": "Markup - Italic",
"scope": "markup.italic",
"settings": {
"fontStyle": "italic",
"foreground": "#FF5370"
}
},
{
"name": "Markup - Bold",
"scope": "markup.bold, markup.bold string",
"settings": {
"fontStyle": "bold",
"foreground": "#FF5370"
}
},
{
"name": "Markup - Bold-Italic",
"scope": "markup.bold markup.italic, markup.italic markup.bold, markup.quote markup.bold, markup.bold markup.italic string, markup.italic markup.bold string, markup.quote markup.bold string",
"settings": {
"fontStyle": "bold",
"foreground": "#FF5370"
}
},
{
"name": "Markup - Underline",
"scope": "markup.underline",
"settings": {
"fontStyle": "underline",
"foreground": "#F76D47"
}
},
{
"name": "Markup - Quote",
"scope": "markup.quote",
"settings": {
"fontStyle": "italic"
}
},
{
"name": "Markup - Raw Block",
"scope": "markup.raw.block",
"settings": {
"foreground": "#7C4DFF"
}
},
{
"name": "Markup - Table",
"scope": "markup.table",
"settings": {
"foreground": "#90A4AE"
}
},
{
"name": "ES7 Bind Operator",
"scope": "source.js constant.other.object.key.js string.unquoted.label.js",
@ -533,6 +480,22 @@
"foreground": "#E53935"
}
},
{
"name": "Class extends, console",
"scope": "support.type.object.console.js, support.type.object.module.js, support.constant.math, meta.class.extends.js > variable.other.readwrite.js",
"settings": {
"fontStyle": "bold italic",
"foreground": "#ffb62c"
}
},
{
"name": "new Class",
"scope": "new.expr entity.name.type",
"settings": {
"fontStyle": "bold",
"foreground": "#ffb62c"
}
},
{
"name": "js/ts italic",
"scope": "entity.other.attribute-name.js, entity.other.attribute-name.ts, entity.other.attribute-name.jsx, entity.other.attribute-name.tsx",
@ -541,25 +504,18 @@
}
},
{
"name": "math js/ts",
"scope": "support.constant.math",
"name": "Build-in props",
"scope": "meta.group.braces.round variable.other.constant, support.type.object.module keyword.operator.accessor, support.constant.property.math.ts",
"settings": {
"foreground": "#ffb62c",
"fontStyle": "bold italic"
}
},
{
"name": "math property js/ts",
"scope": "support.constant.property.math",
"settings": {
"foreground": "#7c4dff"
"fontStyle": "italic bold",
"foreground": "#0096ff"
}
},
{
"name": "ts primitive/builtin types",
"scope": "support.type.primitive.ts, support.type.builtin.ts, support.type.primitive.tsx, support.type.builtin.tsx, entity.name.type.module, entity.name.type",
"settings": {
"foreground": "#E5C07B",
"foreground": "#e5c07b",
"fontStyle": "bold"
}
},
@ -673,63 +629,53 @@
"name": "Markdown - Plain",
"scope": "text.html.markdown, punctuation.definition.list_item.markdown",
"settings": {
"foreground": "#90A4AE"
"foreground": "#546e7a"
}
},
{
"name": "Markdown - Markup Raw Inline",
"scope": "text.html.markdown markup.inline.raw.markdown",
"name": "inline code",
"scope": "markup.inline",
"settings": {
"foreground": "#7C4DFF"
"foreground": "#ff5370"
}
},
{
"name": "Markdown - Markup Raw Inline Punctuation",
"scope": "text.html.markdown markup.inline.raw.markdown punctuation.definition.raw.markdown",
"name": "Bode Block",
"scope": "markup.fenced_code.block.markdown, markup.raw.block",
"settings": {
"foreground": "#E7EAEC"
"foreground": "#90a4ae"
}
},
{
"name": "Markdown - Heading",
"scope": "markdown.heading, markup.heading | markup.heading entity.name, markup.heading.markdown punctuation.definition.heading.markdown",
"scope": "markdown.heading, markup.heading, markup.heading entity.name, markup.heading.markdown, punctuation.definition.heading.markdown",
"settings": {
"foreground": "#91B859"
"foreground": "#ff4628",
"fontStyle": "bold"
}
},
{
"name": "Markdown - Blockquote",
"scope": "markup.quote punctuation.definition.blockquote.markdown",
"scope": "markup.quote",
"settings": {
"foreground": "#E7EAEC"
"fontStyle": "italic",
"foreground": "#90a4ae"
}
},
{
"name": "Markdown - Link",
"scope": "string.other.link.title.markdown",
"name": "link & image",
"scope": "markup.underline.link.image.markdown, markup.underline.link.markdown",
"settings": {
"foreground": "#6182B8"
"fontStyle": "italic",
"foreground": "#b3b5ab"
}
},
{
"name": "Markdown - Link Description",
"scope": "string.other.link.description.title.markdown",
"name": "link text & image text",
"scope": "string.other.link.title.markdown, string.other.link.description.markdown",
"settings": {
"foreground": "#7C4DFF"
}
},
{
"name": "Markdown - Link Anchor",
"scope": "constant.other.reference.link.markdown",
"settings": {
"foreground": "#FFB62C"
}
},
{
"name": "Markdown - Fenced Bode Block Variable",
"scope": "markup.fenced_code.block.markdown, markup.inline.raw.string.markdown",
"settings": {
"foreground": "#90A4AE"
"fontStyle": "",
"foreground": "#0096ff"
}
},
{
@ -747,6 +693,61 @@
"foreground": "#E7EAEC"
}
},
{
"name": "Markup - Italic",
"scope": "markup.italic",
"settings": {
"fontStyle": "italic",
"foreground": "#b3b5ab"
}
},
{
"name": "Markup - Bold",
"scope": "markup.bold, markup.bold string",
"settings": {
"fontStyle": "bold",
"foreground": "#75797b"
}
},
{
"name": "Markup - Bold-Italic",
"scope": "markup.bold markup.italic, markup.italic markup.bold",
"settings": {
"fontStyle": "bold italic",
"foreground": "#75797b"
}
},
{
"name": "delete & insert & underline",
"scope": "markup.inserted, markup.deleted, markup.underline",
"settings": {
"fontStyle": "underline",
"foreground": "#90a4ae"
}
},
{
"name": "underline",
"scope": "markup.underline",
"settings": {
"foreground": "#ff4628"
}
},
{
"name": "order list & unorder list",
"scope": "markup.list",
"settings": {
"foreground": "#35373b",
"fontStyle": "bold"
}
},
{
"name": "all md sign",
"scope": "punctuation.definition.markdown, punctuation.definition.list.begin.markdown, punctuation.definition.heading.markdown, punctuation.definition.quote.begin.markdown, punctuation.definition.italic.markdown, punctuation.definition.bold.markdown, punctuation.definition.italic.markdown",
"settings": {
"fontStyle": "",
"foreground": "#c7c8cb"
}
},
{
"name": "JSON Key - Level 0",
"scope": "source.json meta.structure.dictionary.json support.type.property-name.json",