Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
8c846582
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8c846582
编写于
3月 12, 2016
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow themes to be defined in JSON
上级
2fbdbe80
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
143 addition
and
215 deletion
+143
-215
extensions/theme-colorful-defaults/package.json
extensions/theme-colorful-defaults/package.json
+2
-2
extensions/theme-colorful-defaults/themes/dark_plus.json
extensions/theme-colorful-defaults/themes/dark_plus.json
+62
-0
extensions/theme-colorful-defaults/themes/dark_plus.tmTheme
extensions/theme-colorful-defaults/themes/dark_plus.tmTheme
+0
-102
extensions/theme-colorful-defaults/themes/light_plus.json
extensions/theme-colorful-defaults/themes/light_plus.json
+62
-0
extensions/theme-colorful-defaults/themes/light_plus.tmTheme
extensions/theme-colorful-defaults/themes/light_plus.tmTheme
+0
-105
src/vs/workbench/services/themes/node/themeService.ts
src/vs/workbench/services/themes/node/themeService.ts
+17
-6
未找到文件。
extensions/theme-colorful-defaults/package.json
浏览文件 @
8c846582
...
...
@@ -11,12 +11,12 @@
{
"label"
:
"Dark+ (default dark)"
,
"uiTheme"
:
"vs-dark"
,
"path"
:
"./themes/dark_plus.
tmTheme
"
"path"
:
"./themes/dark_plus.
json
"
},
{
"label"
:
"Light+ (default light)"
,
"uiTheme"
:
"vs"
,
"path"
:
"./themes/light_plus.
tmTheme
"
"path"
:
"./themes/light_plus.
json
"
}
]
}
...
...
extensions/theme-colorful-defaults/themes/dark_plus.json
0 → 100644
浏览文件 @
8c846582
{
"name"
:
"Dark+"
,
"settings"
:
[
{
"name"
:
"Types declaration and references"
,
"scope"
:
[
"meta.type.name"
,
"meta.return.type"
,
"meta.return-type"
,
"meta.cast"
,
"meta.type.annotation"
,
"support.type"
,
"entity.name.class"
,
"entity.name.type"
,
"storage.type.cs"
,
"storage.type.java"
],
"settings"
:
{
"foreground"
:
"#4EC9B0"
}
},
{
"name"
:
"Function declarations"
,
"scope"
:
[
"entity.name.function"
,
"entity.method.name"
],
"settings"
:
{
"foreground"
:
"#DCDCAA"
}
},
{
"name"
:
"Control flow keywords"
,
"scope"
:
"keyword.control"
,
"settings"
:
{
"foreground"
:
"#C586C0"
}
},
{
"name"
:
"Variable and parameter name"
,
"scope"
:
[
"meta.parameter.type.variable"
,
"variable.parameter"
,
"variable"
,
"variable.name"
],
"settings"
:
{
"foreground"
:
"#9CDCFE"
}
},
{
"name"
:
"C includes"
,
"scope"
:
"keyword.control.import"
,
"settings"
:
{
"foreground"
:
"#569CD6"
}
},
{
"name"
:
"CSS property value"
,
"scope"
:
[
"css.support.property-value"
,
"css.constant.rgb-value"
],
"settings"
:
{
"foreground"
:
"#CE9178"
}
},
{
"name"
:
"JSON keys"
,
"scope"
:
"support.type.property-name"
,
"settings"
:
{
"foreground"
:
"#9CDCFE"
}
},
{
"name"
:
"LESS workaround"
,
"scope"
:
"keyword.control.less"
,
"settings"
:
{
"foreground"
:
"#D7BA7D"
}
}
]
}
\ No newline at end of file
extensions/theme-colorful-defaults/themes/dark_plus.tmTheme
已删除
100644 → 0
浏览文件 @
2fbdbe80
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
name
</key>
<string>
Dark+
</string>
<key>
settings
</key>
<array>
<dict>
<key>
name
</key>
<string>
Types declaration and references
</string>
<key>
scope
</key>
<string>
meta.type.name, meta.return.type, meta.return-type, meta.cast, meta.type.annotation, support.type, entity.name.class, entity.name.type,
storage.type.cs, storage.type.java
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#4EC9B0
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
Function declarations
</string>
<key>
scope
</key>
<string>
entity.name.function, entity.method.name
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#DCDCAA
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
Control flow keywords
</string>
<key>
scope
</key>
<string>
keyword.control
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#C586C0
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
Variable and parameter name
</string>
<key>
scope
</key>
<string>
meta.parameter.type.variable, variable.parameter, variable, variable.name
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#9CDCFE
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
C includes
</string>
<key>
scope
</key>
<string>
keyword.control.import
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#569CD6
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
CSS property value
</string>
<key>
scope
</key>
<string>
css.support.property-value, css.constant.rgb-value
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#CE9178
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
JSON keys
</string>
<key>
scope
</key>
<string>
support.type.property-name
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#9CDCFE
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
LESS workaround
</string>
<key>
scope
</key>
<string>
keyword.control.less
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#D7BA7D
</string>
</dict>
</dict>
</array>
</dict>
</plist>
extensions/theme-colorful-defaults/themes/light_plus.json
0 → 100644
浏览文件 @
8c846582
{
"name"
:
"Light+"
,
"settings"
:
[
{
"name"
:
"Types declaration and references"
,
"scope"
:
[
"meta.type.name"
,
"meta.return.type"
,
"meta.return-type"
,
"meta.cast"
,
"meta.type.annotation"
,
"support.type"
,
"entity.name.class"
,
"entity.name.type"
,
"storage.type.cs"
,
"storage.type.java"
],
"settings"
:
{
"foreground"
:
"#267f99"
}
},
{
"name"
:
"Function declarations"
,
"scope"
:
[
"entity.name.function"
,
"entity.method.name"
],
"settings"
:
{
"foreground"
:
"#795E26"
}
},
{
"name"
:
"Control flow keywords"
,
"scope"
:
"keyword.control"
,
"settings"
:
{
"foreground"
:
"#AF00DB"
}
},
{
"name"
:
"Parameter name"
,
"scope"
:
[
"meta.parameter.type.variable"
,
"variable.parameter"
,
"variable"
,
"variable.name"
],
"settings"
:
{
"foreground"
:
"#001080"
}
},
{
"name"
:
"C includes must match meta.preprocessor"
,
"scope"
:
"keyword.control.import"
,
"settings"
:
{
"foreground"
:
"#0000FF"
}
},
{
"name"
:
"CSS keys"
,
"scope"
:
[
"support.type.property-name.css"
,
"support.type.property-name.less"
,
"support.type.property-name.sass"
],
"settings"
:
{
"foreground"
:
"#FF0000"
}
},
{
"name"
:
"JSON keys"
,
"scope"
:
"support.type.property-name"
,
"settings"
:
{
"foreground"
:
"#0451A5"
}
},
{
"name"
:
"LESS workaround"
,
"scope"
:
"keyword.control.less"
,
"settings"
:
{
"foreground"
:
"#800000"
}
}
]
}
\ No newline at end of file
extensions/theme-colorful-defaults/themes/light_plus.tmTheme
已删除
100644 → 0
浏览文件 @
2fbdbe80
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
name
</key>
<string>
Light+
</string>
<key>
settings
</key>
<array>
<dict>
<key>
name
</key>
<string>
Types declaration and references
</string>
<key>
scope
</key>
<string>
meta.type.name, meta.return.type, meta.return-type, meta.cast, meta.type.annotation, support.type, entity.name.class, entity.name.type,
storage.type.cs, storage.type.java
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#267f99
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
Function declarations
</string>
<key>
scope
</key>
<string>
entity.name.function, entity.method.name
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#795E26
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
Control flow keywords
</string>
<key>
scope
</key>
<string>
keyword.control
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#AF00DB
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
Parameter name
</string>
<key>
scope
</key>
<string>
meta.parameter.type.variable, variable.parameter, variable, variable.name
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#001080
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
C includes must match meta.preprocessor
</string>
<key>
scope
</key>
<string>
keyword.control.import
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#0000FF
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
CSS keys
</string>
<key>
scope
</key>
<string>
support.type.property-name.css, support.type.property-name.less, support.type.property-name.sass
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#FF0000
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
JSON keys
</string>
<key>
scope
</key>
<string>
support.type.property-name
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#0451A5
</string>
</dict>
</dict>
<dict>
<key>
name
</key>
<string>
LESS workaround
</string>
<key>
scope
</key>
<string>
keyword.control.less
</string>
<key>
settings
</key>
<dict>
<key>
foreground
</key>
<string>
#800000
</string>
</dict>
</dict>
</array>
</dict>
</plist>
src/vs/workbench/services/themes/node/themeService.ts
浏览文件 @
8c846582
...
...
@@ -7,6 +7,7 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
Paths
=
require
(
'
vs/base/common/paths
'
);
import
Json
=
require
(
'
vs/base/common/json
'
);
import
Themes
=
require
(
'
vs/platform/theme/common/themes
'
);
import
{
IThemeExtensionPoint
}
from
'
vs/platform/theme/common/themeExtensionPoint
'
;
import
{
IExtensionService
}
from
'
vs/platform/extensions/common/extensions
'
;
...
...
@@ -130,11 +131,21 @@ function applyTheme(theme: IThemeData): TPromise<boolean> {
}
return
pfs
.
readFile
(
theme
.
path
).
then
(
content
=>
{
let
parseResult
=
plist
.
parse
(
content
.
toString
());
if
(
parseResult
.
errors
&&
parseResult
.
errors
.
length
)
{
return
TPromise
.
wrapError
(
new
Error
(
nls
.
localize
(
'
error.cannotparse
'
,
"
Problems parsing plist file: {0}
"
,
parseResult
.
errors
.
join
(
'
,
'
))));
let
contentValue
:
any
;
if
(
Paths
.
extname
(
theme
.
path
)
===
'
.json
'
)
{
let
errors
:
string
[]
=
[];
contentValue
=
Json
.
parse
(
content
.
toString
(),
errors
);
if
(
errors
.
length
>
0
)
{
return
TPromise
.
wrapError
(
new
Error
(
nls
.
localize
(
'
error.cannotparsejson
'
,
"
Problems parsing json file: {0}
"
,
errors
.
join
(
'
,
'
))));
}
}
else
{
let
parseResult
=
plist
.
parse
(
content
.
toString
());
if
(
parseResult
.
errors
&&
parseResult
.
errors
.
length
)
{
return
TPromise
.
wrapError
(
new
Error
(
nls
.
localize
(
'
error.cannotparse
'
,
"
Problems parsing plist file: {0}
"
,
parseResult
.
errors
.
join
(
'
,
'
))));
}
contentValue
=
parseResult
.
value
;
}
let
styleSheetContent
=
_processThemeObject
(
theme
.
id
,
parseResult
.
v
alue
);
let
styleSheetContent
=
_processThemeObject
(
theme
.
id
,
contentV
alue
);
theme
.
styleSheetContent
=
styleSheetContent
;
_applyRules
(
styleSheetContent
);
return
true
;
...
...
@@ -163,10 +174,10 @@ function _processThemeObject(themeId: string, themeDocument: any): string {
if
(
index
===
0
&&
!
s
.
scope
)
{
editorSettings
=
s
.
settings
;
}
else
{
let
scope
:
string
=
s
.
scope
;
let
scope
:
string
|
string
[]
=
s
.
scope
;
let
settings
:
string
=
s
.
settings
;
if
(
scope
&&
settings
)
{
let
rules
=
scope
.
split
(
'
,
'
);
let
rules
=
Array
.
isArray
(
scope
)
?
<
string
[]
>
scope
:
scope
.
split
(
'
,
'
);
let
statements
=
_settingsToStatements
(
settings
);
rules
.
forEach
(
rule
=>
{
rule
=
rule
.
trim
().
replace
(
/ /g
,
'
.
'
);
// until we have scope hierarchy in the editor dom: replace spaces with .
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录