Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9b45cbe5
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,体验更适合开发者的 AI 搜索 >>
提交
9b45cbe5
编写于
2月 06, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Trying to get rid of some cases where we use types of `T | null | undefined` in findWidget
上级
539c6cc4
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
95 addition
and
95 deletion
+95
-95
src/vs/base/browser/ui/findinput/findInput.ts
src/vs/base/browser/ui/findinput/findInput.ts
+19
-19
src/vs/base/browser/ui/inputbox/inputBox.ts
src/vs/base/browser/ui/inputbox/inputBox.ts
+25
-25
src/vs/editor/contrib/find/findWidget.ts
src/vs/editor/contrib/find/findWidget.ts
+13
-13
src/vs/editor/contrib/find/simpleFindWidget.ts
src/vs/editor/contrib/find/simpleFindWidget.ts
+15
-15
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
+2
-2
src/vs/editor/contrib/referenceSearch/peekViewWidget.ts
src/vs/editor/contrib/referenceSearch/peekViewWidget.ts
+3
-3
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
+2
-2
src/vs/platform/theme/common/colorRegistry.ts
src/vs/platform/theme/common/colorRegistry.ts
+2
-2
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
+12
-12
src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts
...orkbench/parts/scm/electron-browser/dirtydiffDecorator.ts
+2
-2
未找到文件。
src/vs/base/browser/ui/findinput/findInput.ts
浏览文件 @
9b45cbe5
...
...
@@ -32,7 +32,7 @@ export interface IFindInputOptions extends IFindInputStyles {
}
export
interface
IFindInputStyles
extends
IInputBoxStyles
{
inputActiveOptionBorder
?:
Color
|
null
;
inputActiveOptionBorder
?:
Color
;
}
const
NLS_DEFAULT_LABEL
=
nls
.
localize
(
'
defaultLabel
'
,
"
input
"
);
...
...
@@ -48,20 +48,20 @@ export class FindInput extends Widget {
private
label
:
string
;
private
fixFocusOnOptionClickEnabled
=
true
;
private
inputActiveOptionBorder
?:
Color
|
null
;
private
inputBackground
?:
Color
|
null
;
private
inputForeground
?:
Color
|
null
;
private
inputBorder
?:
Color
|
null
;
private
inputValidationInfoBorder
?:
Color
|
null
;
private
inputValidationInfoBackground
?:
Color
|
null
;
private
inputValidationInfoForeground
?:
Color
|
null
;
private
inputValidationWarningBorder
?:
Color
|
null
;
private
inputValidationWarningBackground
?:
Color
|
null
;
private
inputValidationWarningForeground
?:
Color
|
null
;
private
inputValidationErrorBorder
?:
Color
|
null
;
private
inputValidationErrorBackground
?:
Color
|
null
;
private
inputValidationErrorForeground
?:
Color
|
null
;
private
inputActiveOptionBorder
?:
Color
;
private
inputBackground
?:
Color
;
private
inputForeground
?:
Color
;
private
inputBorder
?:
Color
;
private
inputValidationInfoBorder
?:
Color
;
private
inputValidationInfoBackground
?:
Color
;
private
inputValidationInfoForeground
?:
Color
;
private
inputValidationWarningBorder
?:
Color
;
private
inputValidationWarningBackground
?:
Color
;
private
inputValidationWarningForeground
?:
Color
;
private
inputValidationErrorBorder
?:
Color
;
private
inputValidationErrorBackground
?:
Color
;
private
inputValidationErrorForeground
?:
Color
;
private
regex
:
RegexCheckbox
;
private
wholeWords
:
WholeWordsCheckbox
;
...
...
@@ -202,7 +202,7 @@ export class FindInput extends Widget {
protected
applyStyles
():
void
{
if
(
this
.
domNode
)
{
const
checkBoxStyles
:
ICheckboxStyles
=
{
inputActiveOptionBorder
:
this
.
inputActiveOptionBorder
||
undefined
,
inputActiveOptionBorder
:
this
.
inputActiveOptionBorder
,
};
this
.
regex
.
style
(
checkBoxStyles
);
this
.
wholeWords
.
style
(
checkBoxStyles
);
...
...
@@ -313,7 +313,7 @@ export class FindInput extends Widget {
this
.
regex
=
this
.
_register
(
new
RegexCheckbox
({
appendTitle
:
appendRegexLabel
,
isChecked
:
false
,
inputActiveOptionBorder
:
this
.
inputActiveOptionBorder
||
undefined
inputActiveOptionBorder
:
this
.
inputActiveOptionBorder
}));
this
.
_register
(
this
.
regex
.
onChange
(
viaKeyboard
=>
{
this
.
_onDidOptionChange
.
fire
(
viaKeyboard
);
...
...
@@ -330,7 +330,7 @@ export class FindInput extends Widget {
this
.
wholeWords
=
this
.
_register
(
new
WholeWordsCheckbox
({
appendTitle
:
appendWholeWordsLabel
,
isChecked
:
false
,
inputActiveOptionBorder
:
this
.
inputActiveOptionBorder
||
undefined
inputActiveOptionBorder
:
this
.
inputActiveOptionBorder
}));
this
.
_register
(
this
.
wholeWords
.
onChange
(
viaKeyboard
=>
{
this
.
_onDidOptionChange
.
fire
(
viaKeyboard
);
...
...
@@ -344,7 +344,7 @@ export class FindInput extends Widget {
this
.
caseSensitive
=
this
.
_register
(
new
CaseSensitiveCheckbox
({
appendTitle
:
appendCaseSensitiveLabel
,
isChecked
:
false
,
inputActiveOptionBorder
:
this
.
inputActiveOptionBorder
||
undefined
inputActiveOptionBorder
:
this
.
inputActiveOptionBorder
}));
this
.
_register
(
this
.
caseSensitive
.
onChange
(
viaKeyboard
=>
{
this
.
_onDidOptionChange
.
fire
(
viaKeyboard
);
...
...
src/vs/base/browser/ui/inputbox/inputBox.ts
浏览文件 @
9b45cbe5
...
...
@@ -32,18 +32,18 @@ export interface IInputOptions extends IInputBoxStyles {
}
export
interface
IInputBoxStyles
{
readonly
inputBackground
?:
Color
|
null
;
readonly
inputForeground
?:
Color
|
null
;
readonly
inputBorder
?:
Color
|
null
;
readonly
inputValidationInfoBorder
?:
Color
|
null
;
readonly
inputValidationInfoBackground
?:
Color
|
null
;
readonly
inputValidationInfoForeground
?:
Color
|
null
;
readonly
inputValidationWarningBorder
?:
Color
|
null
;
readonly
inputValidationWarningBackground
?:
Color
|
null
;
readonly
inputValidationWarningForeground
?:
Color
|
null
;
readonly
inputValidationErrorBorder
?:
Color
|
null
;
readonly
inputValidationErrorBackground
?:
Color
|
null
;
readonly
inputValidationErrorForeground
?:
Color
|
null
;
readonly
inputBackground
?:
Color
;
readonly
inputForeground
?:
Color
;
readonly
inputBorder
?:
Color
;
readonly
inputValidationInfoBorder
?:
Color
;
readonly
inputValidationInfoBackground
?:
Color
;
readonly
inputValidationInfoForeground
?:
Color
;
readonly
inputValidationWarningBorder
?:
Color
;
readonly
inputValidationWarningBackground
?:
Color
;
readonly
inputValidationWarningForeground
?:
Color
;
readonly
inputValidationErrorBorder
?:
Color
;
readonly
inputValidationErrorBackground
?:
Color
;
readonly
inputValidationErrorForeground
?:
Color
;
}
export
interface
IInputValidator
{
...
...
@@ -96,19 +96,19 @@ export class InputBox extends Widget {
private
state
:
string
|
null
=
'
idle
'
;
private
cachedHeight
:
number
|
null
;
private
inputBackground
?:
Color
|
null
;
private
inputForeground
?:
Color
|
null
;
private
inputBorder
?:
Color
|
null
;
private
inputValidationInfoBorder
?:
Color
|
null
;
private
inputValidationInfoBackground
?:
Color
|
null
;
private
inputValidationInfoForeground
?:
Color
|
null
;
private
inputValidationWarningBorder
?:
Color
|
null
;
private
inputValidationWarningBackground
?:
Color
|
null
;
private
inputValidationWarningForeground
?:
Color
|
null
;
private
inputValidationErrorBorder
?:
Color
|
null
;
private
inputValidationErrorBackground
?:
Color
|
null
;
private
inputValidationErrorForeground
?:
Color
|
null
;
private
inputBackground
?:
Color
;
private
inputForeground
?:
Color
;
private
inputBorder
?:
Color
;
private
inputValidationInfoBorder
?:
Color
;
private
inputValidationInfoBackground
?:
Color
;
private
inputValidationInfoForeground
?:
Color
;
private
inputValidationWarningBorder
?:
Color
;
private
inputValidationWarningBackground
?:
Color
;
private
inputValidationWarningForeground
?:
Color
;
private
inputValidationErrorBorder
?:
Color
;
private
inputValidationErrorBackground
?:
Color
;
private
inputValidationErrorForeground
?:
Color
;
private
_onDidChange
=
this
.
_register
(
new
Emitter
<
string
>
());
public
readonly
onDidChange
:
Event
<
string
>
=
this
.
_onDidChange
.
event
;
...
...
src/vs/editor/contrib/find/findWidget.ts
浏览文件 @
9b45cbe5
...
...
@@ -530,19 +530,19 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
private
_applyTheme
(
theme
:
ITheme
)
{
let
inputStyles
:
IFindInputStyles
=
{
inputActiveOptionBorder
:
theme
.
getColor
(
inputActiveOptionBorder
),
inputBackground
:
theme
.
getColor
(
inputBackground
),
inputForeground
:
theme
.
getColor
(
inputForeground
),
inputBorder
:
theme
.
getColor
(
inputBorder
),
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
),
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
),
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
),
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
),
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
),
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
),
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
),
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
),
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
)
inputActiveOptionBorder
:
theme
.
getColor
(
inputActiveOptionBorder
)
||
undefined
,
inputBackground
:
theme
.
getColor
(
inputBackground
)
||
undefined
,
inputForeground
:
theme
.
getColor
(
inputForeground
)
||
undefined
,
inputBorder
:
theme
.
getColor
(
inputBorder
)
||
undefined
,
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
)
||
undefined
,
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
)
||
undefined
,
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
)
||
undefined
,
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
)
||
undefined
,
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
)
||
undefined
,
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
)
||
undefined
,
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
)
||
undefined
,
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
)
||
undefined
,
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
)
||
undefined
,
};
this
.
_findInput
.
style
(
inputStyles
);
this
.
_replaceInputBox
.
style
(
inputStyles
);
...
...
src/vs/editor/contrib/find/simpleFindWidget.ts
浏览文件 @
9b45cbe5
...
...
@@ -6,7 +6,7 @@
import
'
vs/css!./simpleFindWidget
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
FindInput
}
from
'
vs/base/browser/ui/findinput/findInput
'
;
import
{
FindInput
,
IFindInputStyles
}
from
'
vs/base/browser/ui/findinput/findInput
'
;
import
{
Widget
}
from
'
vs/base/browser/ui/widget
'
;
import
{
Delayer
}
from
'
vs/base/common/async
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
...
...
@@ -159,20 +159,20 @@ export abstract class SimpleFindWidget extends Widget {
}
public
updateTheme
(
theme
:
ITheme
):
void
{
const
inputStyles
=
{
inputActiveOptionBorder
:
theme
.
getColor
(
inputActiveOptionBorder
),
inputBackground
:
theme
.
getColor
(
inputBackground
),
inputForeground
:
theme
.
getColor
(
inputForeground
),
inputBorder
:
theme
.
getColor
(
inputBorder
),
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
),
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
),
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
),
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
),
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
),
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
),
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
),
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
),
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
)
const
inputStyles
:
IFindInputStyles
=
{
inputActiveOptionBorder
:
theme
.
getColor
(
inputActiveOptionBorder
)
||
undefined
,
inputBackground
:
theme
.
getColor
(
inputBackground
)
||
undefined
,
inputForeground
:
theme
.
getColor
(
inputForeground
)
||
undefined
,
inputBorder
:
theme
.
getColor
(
inputBorder
)
||
undefined
,
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
)
||
undefined
,
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
)
||
undefined
,
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
)
||
undefined
,
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
)
||
undefined
,
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
)
||
undefined
,
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
)
||
undefined
,
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
)
||
undefined
,
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
)
||
undefined
,
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
)
||
undefined
};
this
.
_findInput
.
style
(
inputStyles
);
}
...
...
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
浏览文件 @
9b45cbe5
...
...
@@ -165,7 +165,7 @@ export class MarkerNavigationWidget extends ZoneWidget {
private
_message
:
MessageWidget
;
private
_callOnDispose
:
IDisposable
[]
=
[];
private
_severity
:
MarkerSeverity
;
private
_backgroundColor
:
Color
|
null
;
private
_backgroundColor
?:
Color
;
private
_onDidSelectRelatedInformation
=
new
Emitter
<
IRelatedInformation
>
();
readonly
onDidSelectRelatedInformation
:
Event
<
IRelatedInformation
>
=
this
.
_onDidSelectRelatedInformation
.
event
;
...
...
@@ -185,7 +185,7 @@ export class MarkerNavigationWidget extends ZoneWidget {
}
private
_applyTheme
(
theme
:
ITheme
)
{
this
.
_backgroundColor
=
theme
.
getColor
(
editorMarkerNavigationBackground
);
this
.
_backgroundColor
=
theme
.
getColor
(
editorMarkerNavigationBackground
)
||
undefined
;
let
colorId
=
editorMarkerNavigationError
;
if
(
this
.
_severity
===
MarkerSeverity
.
Warning
)
{
colorId
=
editorMarkerNavigationWarning
;
...
...
src/vs/editor/contrib/referenceSearch/peekViewWidget.ts
浏览文件 @
9b45cbe5
...
...
@@ -34,9 +34,9 @@ export function getOuterEditor(accessor: ServicesAccessor): ICodeEditor | null {
}
export
interface
IPeekViewStyles
extends
IStyles
{
headerBackgroundColor
?:
Color
|
null
;
primaryHeadingColor
?:
Color
|
null
;
secondaryHeadingColor
?:
Color
|
null
;
headerBackgroundColor
?:
Color
;
primaryHeadingColor
?:
Color
;
secondaryHeadingColor
?:
Color
;
}
export
type
IPeekViewOptions
=
IOptions
&
IPeekViewStyles
;
...
...
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
浏览文件 @
9b45cbe5
...
...
@@ -279,8 +279,8 @@ export class ReferenceWidget extends PeekViewWidget {
arrowColor
:
borderColor
,
frameColor
:
borderColor
,
headerBackgroundColor
:
theme
.
getColor
(
peekViewTitleBackground
)
||
Color
.
transparent
,
primaryHeadingColor
:
theme
.
getColor
(
peekViewTitleForeground
),
secondaryHeadingColor
:
theme
.
getColor
(
peekViewTitleInfoForeground
)
primaryHeadingColor
:
theme
.
getColor
(
peekViewTitleForeground
)
||
undefined
,
secondaryHeadingColor
:
theme
.
getColor
(
peekViewTitleInfoForeground
)
||
undefined
});
}
...
...
src/vs/platform/theme/common/colorRegistry.ts
浏览文件 @
9b45cbe5
...
...
@@ -132,9 +132,9 @@ class ColorRegistry implements IColorRegistry {
}
public
resolveDefaultColor
(
id
:
ColorIdentifier
,
theme
:
ITheme
):
Color
|
null
{
le
t
colorDesc
=
this
.
colorsById
[
id
];
cons
t
colorDesc
=
this
.
colorsById
[
id
];
if
(
colorDesc
&&
colorDesc
.
defaults
)
{
le
t
colorValue
=
colorDesc
.
defaults
[
theme
.
type
];
cons
t
colorValue
=
colorDesc
.
defaults
[
theme
.
type
];
return
resolveColorValue
(
colorValue
,
theme
);
}
return
null
;
...
...
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
浏览文件 @
9b45cbe5
...
...
@@ -100,18 +100,18 @@ export class QuickInputBox {
style
(
theme
:
ITheme
)
{
this
.
inputBox
.
style
({
inputForeground
:
theme
.
getColor
(
inputForeground
),
inputBackground
:
theme
.
getColor
(
inputBackground
),
inputBorder
:
theme
.
getColor
(
inputBorder
),
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
),
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
),
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
),
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
),
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
),
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
),
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
),
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
),
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
),
inputForeground
:
theme
.
getColor
(
inputForeground
)
||
undefined
,
inputBackground
:
theme
.
getColor
(
inputBackground
)
||
undefined
,
inputBorder
:
theme
.
getColor
(
inputBorder
)
||
undefined
,
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
)
||
undefined
,
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
)
||
undefined
,
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
)
||
undefined
,
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
)
||
undefined
,
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
)
||
undefined
,
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
)
||
undefined
,
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
)
||
undefined
,
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
)
||
undefined
,
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
)
||
undefined
,
});
}
...
...
src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts
浏览文件 @
9b45cbe5
...
...
@@ -365,8 +365,8 @@ class DirtyDiffWidget extends PeekViewWidget {
arrowColor
:
borderColor
,
frameColor
:
borderColor
,
headerBackgroundColor
:
theme
.
getColor
(
peekViewTitleBackground
)
||
Color
.
transparent
,
primaryHeadingColor
:
theme
.
getColor
(
peekViewTitleForeground
),
secondaryHeadingColor
:
theme
.
getColor
(
peekViewTitleInfoForeground
)
primaryHeadingColor
:
theme
.
getColor
(
peekViewTitleForeground
)
||
undefined
,
secondaryHeadingColor
:
theme
.
getColor
(
peekViewTitleInfoForeground
)
||
undefined
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录