Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9c7ee4e7
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9c7ee4e7
编写于
5月 15, 2017
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[theme] theme 'inspect tokens'
上级
d1dc19b6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
7 deletion
+22
-7
src/vs/editor/contrib/inspectTokens/browser/inspectTokens.css
...vs/editor/contrib/inspectTokens/browser/inspectTokens.css
+4
-5
src/vs/editor/contrib/inspectTokens/browser/inspectTokens.ts
src/vs/editor/contrib/inspectTokens/browser/inspectTokens.ts
+18
-2
未找到文件。
src/vs/editor/contrib/inspectTokens/browser/inspectTokens.css
浏览文件 @
9c7ee4e7
...
...
@@ -4,8 +4,6 @@
*--------------------------------------------------------------------------------------------*/
.monaco-editor
.tokens-inspect-widget
{
background-color
:
#F3F3F3
;
border
:
1px
solid
#CCC
;
z-index
:
50
;
-webkit-user-select
:
text
;
-ms-user-select
:
text
;
...
...
@@ -16,9 +14,10 @@
padding
:
10px
;
}
.monaco-editor.vs-dark
.tokens-inspect-widget
{
background-color
:
#2D2D30
;
border-color
:
#555
;
}
.monaco-editor.hc-black
.tokens-inspect-widget
{
background-color
:
#0C141F
;
}
.tokens-inspect-separator
{
height
:
1px
;
border
:
0
;
}
.monaco-editor
.tokens-inspect-widget
.tm-token
{
font-family
:
monospace
;
...
...
src/vs/editor/contrib/inspectTokens/browser/inspectTokens.ts
浏览文件 @
9c7ee4e7
...
...
@@ -21,6 +21,9 @@ import { IStandaloneThemeService } from 'vs/editor/common/services/standaloneThe
import
{
NULL_STATE
,
nullTokenize
,
nullTokenize2
}
from
'
vs/editor/common/modes/nullMode
'
;
import
{
Token
}
from
'
vs/editor/common/core/token
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
registerThemingParticipant
,
HIGH_CONTRAST
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
editorHoverBackground
,
editorHoverBorder
}
from
'
vs/platform/theme/common/colorRegistry
'
;
@
editorContribution
class
InspectTokensController
extends
Disposable
implements
IEditorContribution
{
...
...
@@ -230,7 +233,7 @@ class InspectTokensWidget extends Disposable implements IContentWidget {
}
result
+=
`<h2 class="tm-token">
${
renderTokenText
(
tokenText
)}
<span class="tm-token-length">(
${
tokenText
.
length
}
${
tokenText
.
length
===
1
?
'
char
'
:
'
chars
'
}
)</span></h2>`
;
result
+=
`<hr style="clear:both"/>`
;
result
+=
`<hr
class="tokens-inspect-separator"
style="clear:both"/>`
;
let
metadata
=
this
.
_decodeMetadata
(
data
.
tokens2
[(
token2Index
<<
1
)
+
1
]);
result
+=
`<table class="tm-metadata-table"><tbody>`
;
...
...
@@ -241,7 +244,7 @@ class InspectTokensWidget extends Disposable implements IContentWidget {
result
+=
`<tr><td class="tm-metadata-key">background</td><td class="tm-metadata-value">
${
metadata
.
background
.
toRGBHex
()}
</td>`
;
result
+=
`</tbody></table>`
;
result
+=
`<hr/>`
;
result
+=
`<hr
class="tokens-inspect-separator"
/>`
;
if
(
token1Index
<
data
.
tokens1
.
length
)
{
result
+=
`<span class="tm-token-type">
${
escape
(
data
.
tokens1
[
token1Index
].
type
)}
</span>`
;
...
...
@@ -330,3 +333,16 @@ class InspectTokensWidget extends Disposable implements IContentWidget {
};
}
}
registerThemingParticipant
((
theme
,
collector
)
=>
{
let
border
=
theme
.
getColor
(
editorHoverBorder
);
if
(
border
)
{
let
borderWidth
=
theme
.
type
===
HIGH_CONTRAST
?
2
:
1
;
collector
.
addRule
(
`.monaco-editor .tokens-inspect-widget { border:
${
borderWidth
}
px solid
${
border
}
; }`
);
collector
.
addRule
(
`.monaco-editor .tokens-inspect-widget .tokens-inspect-separator { background-color:
${
border
}
; }`
);
}
let
background
=
theme
.
getColor
(
editorHoverBackground
);
if
(
background
)
{
collector
.
addRule
(
`.monaco-editor .tokens-inspect-widget { background-color:
${
background
}
; }`
);
}
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录