Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
f97736cc
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,发现更多精彩内容 >>
提交
f97736cc
编写于
12月 07, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null check findInput
上级
c25b7499
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
30 deletion
+33
-30
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+1
-0
src/vs/base/browser/ui/findinput/findInput.ts
src/vs/base/browser/ui/findinput/findInput.ts
+31
-29
src/vs/base/browser/ui/inputbox/inputBox.ts
src/vs/base/browser/ui/inputbox/inputBox.ts
+1
-1
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
f97736cc
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
"./vs/base/browser/ui/checkbox/checkbox.ts"
,
"./vs/base/browser/ui/checkbox/checkbox.ts"
,
"./vs/base/browser/ui/contextview/contextview.ts"
,
"./vs/base/browser/ui/contextview/contextview.ts"
,
"./vs/base/browser/ui/countBadge/countBadge.ts"
,
"./vs/base/browser/ui/countBadge/countBadge.ts"
,
"./vs/base/browser/ui/findinput/findInput.ts"
,
"./vs/base/browser/ui/findinput/findInputCheckboxes.ts"
,
"./vs/base/browser/ui/findinput/findInputCheckboxes.ts"
,
"./vs/base/browser/ui/grid/grid.ts"
,
"./vs/base/browser/ui/grid/grid.ts"
,
"./vs/base/browser/ui/grid/gridview.ts"
,
"./vs/base/browser/ui/grid/gridview.ts"
,
...
...
src/vs/base/browser/ui/findinput/findInput.ts
浏览文件 @
f97736cc
...
@@ -44,24 +44,24 @@ export class FindInput extends Widget {
...
@@ -44,24 +44,24 @@ export class FindInput extends Widget {
private
contextViewProvider
:
IContextViewProvider
;
private
contextViewProvider
:
IContextViewProvider
;
private
width
:
number
;
private
width
:
number
;
private
placeholder
:
string
;
private
placeholder
:
string
;
private
validation
:
IInputValidator
;
private
validation
?
:
IInputValidator
;
private
label
:
string
;
private
label
:
string
;
private
fixFocusOnOptionClickEnabled
=
true
;
private
fixFocusOnOptionClickEnabled
=
true
;
private
inputActiveOptionBorder
:
Color
;
private
inputActiveOptionBorder
?
:
Color
;
private
inputBackground
:
Color
;
private
inputBackground
?
:
Color
;
private
inputForeground
:
Color
;
private
inputForeground
?
:
Color
;
private
inputBorder
:
Color
;
private
inputBorder
?
:
Color
;
private
inputValidationInfoBorder
:
Color
;
private
inputValidationInfoBorder
?
:
Color
;
private
inputValidationInfoBackground
:
Color
;
private
inputValidationInfoBackground
?
:
Color
;
private
inputValidationInfoForeground
:
Color
;
private
inputValidationInfoForeground
?
:
Color
;
private
inputValidationWarningBorder
:
Color
;
private
inputValidationWarningBorder
?
:
Color
;
private
inputValidationWarningBackground
:
Color
;
private
inputValidationWarningBackground
?
:
Color
;
private
inputValidationWarningForeground
:
Color
;
private
inputValidationWarningForeground
?
:
Color
;
private
inputValidationErrorBorder
:
Color
;
private
inputValidationErrorBorder
?
:
Color
;
private
inputValidationErrorBackground
:
Color
;
private
inputValidationErrorBackground
?
:
Color
;
private
inputValidationErrorForeground
:
Color
;
private
inputValidationErrorForeground
?
:
Color
;
private
regex
:
RegexCheckbox
;
private
regex
:
RegexCheckbox
;
private
wholeWords
:
WholeWordsCheckbox
;
private
wholeWords
:
WholeWordsCheckbox
;
...
@@ -90,7 +90,7 @@ export class FindInput extends Widget {
...
@@ -90,7 +90,7 @@ export class FindInput extends Widget {
private
_onRegexKeyDown
=
this
.
_register
(
new
Emitter
<
IKeyboardEvent
>
());
private
_onRegexKeyDown
=
this
.
_register
(
new
Emitter
<
IKeyboardEvent
>
());
public
readonly
onRegexKeyDown
:
Event
<
IKeyboardEvent
>
=
this
.
_onRegexKeyDown
.
event
;
public
readonly
onRegexKeyDown
:
Event
<
IKeyboardEvent
>
=
this
.
_onRegexKeyDown
.
event
;
constructor
(
parent
:
HTMLElement
,
contextViewProvider
:
IContextViewProvider
,
private
readonly
_showOptionButtons
:
boolean
,
options
?
:
IFindInputOptions
)
{
constructor
(
parent
:
HTMLElement
,
contextViewProvider
:
IContextViewProvider
,
private
readonly
_showOptionButtons
:
boolean
,
options
:
IFindInputOptions
)
{
super
();
super
();
this
.
contextViewProvider
=
contextViewProvider
;
this
.
contextViewProvider
=
contextViewProvider
;
this
.
width
=
options
.
width
||
100
;
this
.
width
=
options
.
width
||
100
;
...
@@ -113,13 +113,7 @@ export class FindInput extends Widget {
...
@@ -113,13 +113,7 @@ export class FindInput extends Widget {
this
.
inputValidationErrorBackground
=
options
.
inputValidationErrorBackground
;
this
.
inputValidationErrorBackground
=
options
.
inputValidationErrorBackground
;
this
.
inputValidationErrorForeground
=
options
.
inputValidationErrorForeground
;
this
.
inputValidationErrorForeground
=
options
.
inputValidationErrorForeground
;
this
.
regex
=
null
;
this
.
buildDomNode
(
options
.
appendCaseSensitiveLabel
||
''
,
options
.
appendWholeWordsLabel
||
''
,
options
.
appendRegexLabel
||
''
,
options
.
history
||
[],
!!
options
.
flexibleHeight
);
this
.
wholeWords
=
null
;
this
.
caseSensitive
=
null
;
this
.
domNode
=
null
;
this
.
inputBox
=
null
;
this
.
buildDomNode
(
options
.
appendCaseSensitiveLabel
||
''
,
options
.
appendWholeWordsLabel
||
''
,
options
.
appendRegexLabel
||
''
,
options
.
history
,
options
.
flexibleHeight
);
if
(
Boolean
(
parent
))
{
if
(
Boolean
(
parent
))
{
parent
.
appendChild
(
this
.
domNode
);
parent
.
appendChild
(
this
.
domNode
);
...
@@ -298,7 +292,7 @@ export class FindInput extends Widget {
...
@@ -298,7 +292,7 @@ export class FindInput extends Widget {
placeholder
:
this
.
placeholder
||
''
,
placeholder
:
this
.
placeholder
||
''
,
ariaLabel
:
this
.
label
||
''
,
ariaLabel
:
this
.
label
||
''
,
validationOptions
:
{
validationOptions
:
{
validation
:
this
.
validation
||
null
validation
:
this
.
validation
},
},
inputBackground
:
this
.
inputBackground
,
inputBackground
:
this
.
inputBackground
,
inputForeground
:
this
.
inputForeground
,
inputForeground
:
this
.
inputForeground
,
...
@@ -370,7 +364,7 @@ export class FindInput extends Widget {
...
@@ -370,7 +364,7 @@ export class FindInput extends Widget {
if
(
event
.
equals
(
KeyCode
.
LeftArrow
)
||
event
.
equals
(
KeyCode
.
RightArrow
)
||
event
.
equals
(
KeyCode
.
Escape
))
{
if
(
event
.
equals
(
KeyCode
.
LeftArrow
)
||
event
.
equals
(
KeyCode
.
RightArrow
)
||
event
.
equals
(
KeyCode
.
Escape
))
{
let
index
=
indexes
.
indexOf
(
<
HTMLElement
>
document
.
activeElement
);
let
index
=
indexes
.
indexOf
(
<
HTMLElement
>
document
.
activeElement
);
if
(
index
>=
0
)
{
if
(
index
>=
0
)
{
let
newIndex
:
number
;
let
newIndex
:
number
=
-
1
;
if
(
event
.
equals
(
KeyCode
.
RightArrow
))
{
if
(
event
.
equals
(
KeyCode
.
RightArrow
))
{
newIndex
=
(
index
+
1
)
%
indexes
.
length
;
newIndex
=
(
index
+
1
)
%
indexes
.
length
;
}
else
if
(
event
.
equals
(
KeyCode
.
LeftArrow
))
{
}
else
if
(
event
.
equals
(
KeyCode
.
LeftArrow
))
{
...
@@ -405,19 +399,27 @@ export class FindInput extends Widget {
...
@@ -405,19 +399,27 @@ export class FindInput extends Widget {
}
}
public
validate
():
void
{
public
validate
():
void
{
this
.
inputBox
.
validate
();
if
(
this
.
inputBox
)
{
this
.
inputBox
.
validate
();
}
}
}
public
showMessage
(
message
:
InputBoxMessage
):
void
{
public
showMessage
(
message
:
InputBoxMessage
):
void
{
this
.
inputBox
.
showMessage
(
message
);
if
(
this
.
inputBox
)
{
this
.
inputBox
.
showMessage
(
message
);
}
}
}
public
clearMessage
():
void
{
public
clearMessage
():
void
{
this
.
inputBox
.
hideMessage
();
if
(
this
.
inputBox
)
{
this
.
inputBox
.
hideMessage
();
}
}
}
private
clearValidation
():
void
{
private
clearValidation
():
void
{
this
.
inputBox
.
hideMessage
();
if
(
this
.
inputBox
)
{
this
.
inputBox
.
hideMessage
();
}
}
}
public
dispose
():
void
{
public
dispose
():
void
{
...
...
src/vs/base/browser/ui/inputbox/inputBox.ts
浏览文件 @
f97736cc
...
@@ -57,7 +57,7 @@ export interface IMessage {
...
@@ -57,7 +57,7 @@ export interface IMessage {
}
}
export
interface
IInputValidationOptions
{
export
interface
IInputValidationOptions
{
validation
:
IInputValidator
;
validation
?
:
IInputValidator
;
}
}
export
const
enum
MessageType
{
export
const
enum
MessageType
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录