Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d8969035
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,发现更多精彩内容 >>
提交
d8969035
编写于
2月 15, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null supressesions in themes.test
上级
d94ce50f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
9 deletion
+11
-9
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+2
-0
src/vs/workbench/contrib/themes/test/electron-browser/themes.test.contribution.ts
.../themes/test/electron-browser/themes.test.contribution.ts
+9
-9
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
d8969035
...
...
@@ -662,6 +662,7 @@
"./vs/workbench/contrib/terminal/test/node/terminalCommandTracker.test.ts"
,
"./vs/workbench/contrib/terminal/test/node/terminalEnvironment.test.ts"
,
"./vs/workbench/contrib/themes/electron-browser/themes.contribution.ts"
,
"./vs/workbench/contrib/themes/test/electron-browser/themes.test.contribution.ts"
,
"./vs/workbench/contrib/url/electron-browser/url.contribution.ts"
,
"./vs/workbench/contrib/webview/electron-browser/webviewProtocols.ts"
,
"./vs/workbench/electron-browser/window.ts"
,
...
...
@@ -772,6 +773,7 @@
"./vs/workbench/test/browser/viewlet.test.ts"
,
"./vs/workbench/test/common/editor/editorOptions.test.ts"
,
"./vs/workbench/test/common/notifications.test.ts"
,
"./vs/workbench/test/electron-browser/api/extHost.api.impl.test.ts"
,
"./vs/workbench/test/electron-browser/api/extHostDocumentData.test.ts"
,
"./vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts"
,
"./vs/workbench/test/electron-browser/api/extHostTypes.test.ts"
,
...
...
src/vs/workbench/contrib/themes/test/electron-browser/themes.test.contribution.ts
浏览文件 @
d8969035
...
...
@@ -69,7 +69,7 @@ class ThemeDocument {
return
this
.
_generateExplanation
(
'
default
'
,
color
);
}
let
expected
=
Color
.
fromHex
(
matchingRule
.
settings
.
foreground
);
let
expected
=
Color
.
fromHex
(
matchingRule
.
settings
.
foreground
!
);
if
(
!
color
.
equals
(
expected
))
{
throw
new
Error
(
`[
${
this
.
_theme
.
label
}
]: Unexpected color
${
Color
.
Format
.
CSS
.
formatHexA
(
color
)}
for
${
scopes
}
. Expected
${
Color
.
Format
.
CSS
.
formatHexA
(
expected
)}
coming in from
${
matchingRule
.
rawSelector
}
`
);
}
...
...
@@ -78,7 +78,7 @@ class ThemeDocument {
private
_findMatchingThemeRule
(
scopes
:
string
):
ThemeRule
{
if
(
!
this
.
_cache
[
scopes
])
{
this
.
_cache
[
scopes
]
=
findMatchingThemeRule
(
this
.
_theme
,
scopes
.
split
(
'
'
));
this
.
_cache
[
scopes
]
=
findMatchingThemeRule
(
this
.
_theme
,
scopes
.
split
(
'
'
))
!
;
}
return
this
.
_cache
[
scopes
];
}
...
...
@@ -112,7 +112,7 @@ class Snapper {
result
[
resultLen
++
]
=
{
text
:
tokenText
,
color
:
colorMap
[
color
]
color
:
colorMap
!
[
color
]
};
}
...
...
@@ -178,16 +178,16 @@ class Snapper {
let
defaultThemes
=
themeDatas
.
filter
(
themeData
=>
!!
getThemeName
(
themeData
.
id
));
for
(
let
defaultTheme
of
defaultThemes
)
{
let
themeId
=
defaultTheme
.
id
;
let
success
=
await
this
.
themeService
.
setColorTheme
(
themeId
,
null
);
let
success
=
await
this
.
themeService
.
setColorTheme
(
themeId
,
undefined
);
if
(
success
)
{
let
themeName
=
getThemeName
(
themeId
);
result
[
themeName
]
=
{
result
[
themeName
!
]
=
{
document
:
new
ThemeDocument
(
this
.
themeService
.
getColorTheme
()),
tokens
:
this
.
_themedTokenize
(
grammar
,
lines
)
};
}
}
await
this
.
themeService
.
setColorTheme
(
currentTheme
.
id
,
null
);
await
this
.
themeService
.
setColorTheme
(
currentTheme
.
id
,
undefined
);
return
result
;
}
...
...
@@ -215,7 +215,7 @@ class Snapper {
public
captureSyntaxTokens
(
fileName
:
string
,
content
:
string
):
Promise
<
IToken
[]
>
{
const
modeId
=
this
.
modeService
.
getModeIdByFilepathOrFirstLine
(
fileName
);
return
this
.
textMateService
.
createGrammar
(
modeId
).
then
((
grammar
)
=>
{
return
this
.
textMateService
.
createGrammar
(
modeId
!
).
then
((
grammar
)
=>
{
let
lines
=
content
.
split
(
/
\r\n
|
\r
|
\n
/
);
let
result
=
this
.
_tokenize
(
grammar
,
lines
);
...
...
@@ -240,8 +240,8 @@ CommandsRegistry.registerCommand('_workbench.captureSyntaxTokens', function (acc
};
if
(
!
resource
)
{
le
t
editorService
=
accessor
.
get
(
IEditorService
);
let
file
=
toResource
(
editorService
.
activeEditor
,
{
filter
:
'
file
'
})
;
cons
t
editorService
=
accessor
.
get
(
IEditorService
);
const
file
=
editorService
.
activeEditor
?
toResource
(
editorService
.
activeEditor
,
{
filter
:
'
file
'
})
:
null
;
if
(
file
)
{
process
(
file
).
then
(
result
=>
{
console
.
log
(
result
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录