Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
fb606be7
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
fb606be7
编写于
10月 15, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add typings for strict null checks
上级
148c2c41
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
31 addition
and
25 deletion
+31
-25
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+7
-1
src/vs/base/browser/ui/progressbar/progressbar.ts
src/vs/base/browser/ui/progressbar/progressbar.ts
+6
-6
src/vs/base/common/octicon.ts
src/vs/base/common/octicon.ts
+1
-1
src/vs/base/node/request.ts
src/vs/base/node/request.ts
+8
-8
src/vs/editor/contrib/suggest/suggest.ts
src/vs/editor/contrib/suggest/suggest.ts
+1
-1
src/vs/workbench/browser/part.ts
src/vs/workbench/browser/part.ts
+7
-7
src/vs/workbench/parts/surveys/electron-browser/nps.contribution.ts
...kbench/parts/surveys/electron-browser/nps.contribution.ts
+1
-1
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
fb606be7
...
...
@@ -25,6 +25,7 @@
"./vs/base/browser/ui/list/splice.ts"
,
"./vs/base/browser/ui/octiconLabel/octiconLabel.mock.ts"
,
"./vs/base/browser/ui/octiconLabel/octiconLabel.ts"
,
"./vs/base/browser/ui/progressbar/progressbar.ts"
,
"./vs/base/browser/ui/scrollbar/abstractScrollbar.ts"
,
"./vs/base/browser/ui/scrollbar/horizontalScrollbar.ts"
,
"./vs/base/browser/ui/scrollbar/scrollableElement.ts"
,
...
...
@@ -35,7 +36,6 @@
"./vs/base/browser/ui/scrollbar/verticalScrollbar.ts"
,
"./vs/base/browser/ui/tree/tree.ts"
,
"./vs/base/browser/ui/widget.ts"
,
"./vs/base/common/actions.ts"
,
"./vs/base/common/amd.ts"
,
"./vs/base/common/arrays.ts"
,
"./vs/base/common/assert.ts"
,
...
...
@@ -76,6 +76,7 @@
"./vs/base/common/normalization.ts"
,
"./vs/base/common/numbers.ts"
,
"./vs/base/common/objects.ts"
,
"./vs/base/common/octicon.ts"
,
"./vs/base/common/paging.ts"
,
"./vs/base/common/parsers.ts"
,
"./vs/base/common/paths.ts"
,
...
...
@@ -100,6 +101,7 @@
"./vs/base/node/id.ts"
,
"./vs/base/node/paths.ts"
,
"./vs/base/node/ports.ts"
,
"./vs/base/node/request.ts"
,
"./vs/base/parts/contextmenu/common/contextmenu.ts"
,
"./vs/base/parts/contextmenu/electron-main/contextmenu.ts"
,
"./vs/base/parts/quickopen/common/quickOpen.ts"
,
...
...
@@ -316,6 +318,7 @@
"./vs/editor/contrib/message/messageController.ts"
,
"./vs/editor/contrib/parameterHints/provideSignatureHelp.ts"
,
"./vs/editor/contrib/quickOpen/quickOpen.ts"
,
"./vs/editor/contrib/suggest/suggest.ts"
,
"./vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.ts"
,
"./vs/editor/contrib/wordHighlighter/wordHighlighter.ts"
,
"./vs/editor/contrib/wordOperations/wordOperations.ts"
,
...
...
@@ -403,6 +406,7 @@
"./vs/platform/quickOpen/common/quickOpen.ts"
,
"./vs/platform/quickinput/common/quickInput.ts"
,
"./vs/platform/registry/common/platform.ts"
,
"./vs/platform/request/node/request.ts"
,
"./vs/platform/search/common/search.ts"
,
"./vs/platform/state/common/state.ts"
,
"./vs/platform/statusbar/common/statusbar.ts"
,
...
...
@@ -424,6 +428,7 @@
"./vs/platform/workspaces/common/workspaces.ts"
,
"./vs/platform/workspaces/node/workspaces.ts"
,
"./vs/workbench/api/shared/tasks.ts"
,
"./vs/workbench/browser/part.ts"
,
"./vs/workbench/browser/parts/quickinput/quickInputUtils.ts"
,
"./vs/workbench/browser/parts/statusbar/statusbar.ts"
,
"./vs/workbench/common/activity.ts"
,
...
...
@@ -461,6 +466,7 @@
"./vs/workbench/parts/scm/common/scm.ts"
,
"./vs/workbench/parts/scm/electron-browser/scmUtil.ts"
,
"./vs/workbench/parts/search/common/constants.ts"
,
"./vs/workbench/parts/surveys/electron-browser/nps.contribution.ts"
,
"./vs/workbench/parts/tasks/common/taskTemplates.ts"
,
"./vs/workbench/parts/terminal/browser/terminalWidgetManager.ts"
,
"./vs/workbench/parts/terminal/common/terminal.ts"
,
...
...
src/vs/base/browser/ui/progressbar/progressbar.ts
浏览文件 @
fb606be7
...
...
@@ -37,8 +37,8 @@ export class ProgressBar extends Disposable {
private
workedVal
:
number
;
private
element
:
HTMLElement
;
private
bit
:
HTMLElement
;
private
totalWork
:
number
;
private
progressBarBackground
:
Color
;
private
totalWork
:
number
|
undefined
;
private
progressBarBackground
:
Color
|
undefined
;
private
showDelayedScheduler
:
RunOnceScheduler
;
constructor
(
container
:
HTMLElement
,
options
?:
IProgressBarOptions
)
{
...
...
@@ -146,7 +146,7 @@ export class ProgressBar extends Disposable {
* Finds out if this progress bar is configured with total work
*/
hasTotal
():
boolean
{
return
!
isNaN
(
this
.
totalWork
);
return
!
isNaN
(
this
.
totalWork
as
number
);
}
/**
...
...
@@ -172,10 +172,10 @@ export class ProgressBar extends Disposable {
}
private
doSetWorked
(
value
:
number
):
ProgressBar
{
assert
.
ok
(
!
isNaN
(
this
.
totalWork
),
'
Total work not set
'
);
assert
.
ok
(
!
isNaN
(
this
.
totalWork
as
number
),
'
Total work not set
'
);
this
.
workedVal
=
value
;
this
.
workedVal
=
Math
.
min
(
this
.
totalWork
,
this
.
workedVal
);
this
.
workedVal
=
Math
.
min
(
this
.
totalWork
as
number
,
this
.
workedVal
);
if
(
hasClass
(
this
.
element
,
css_infinite
))
{
removeClass
(
this
.
element
,
css_infinite
);
...
...
@@ -193,7 +193,7 @@ export class ProgressBar extends Disposable {
addClass
(
this
.
element
,
css_discrete
);
}
this
.
bit
.
style
.
width
=
100
*
(
this
.
workedVal
/
this
.
totalWork
)
+
'
%
'
;
this
.
bit
.
style
.
width
=
100
*
(
this
.
workedVal
/
(
this
.
totalWork
as
number
)
)
+
'
%
'
;
return
this
;
}
...
...
src/vs/base/common/octicon.ts
浏览文件 @
fb606be7
...
...
@@ -97,7 +97,7 @@ function doParseOcticons(text: string, firstOcticonIndex: number): IParsedOctico
return
{
text
:
textWithoutOcticons
,
octiconOffsets
};
}
export
function
matchesFuzzyOcticonAware
(
query
:
string
,
target
:
IParsedOcticons
,
enableSeparateSubstringMatching
=
false
):
IMatch
[]
{
export
function
matchesFuzzyOcticonAware
(
query
:
string
,
target
:
IParsedOcticons
,
enableSeparateSubstringMatching
=
false
):
IMatch
[]
|
null
{
const
{
text
,
octiconOffsets
}
=
target
;
// Return early if there are no octicon markers in the word to match against
...
...
src/vs/base/node/request.ts
浏览文件 @
fb606be7
...
...
@@ -49,7 +49,7 @@ export interface IRequestFunction {
}
async
function
getNodeRequest
(
options
:
IRequestOptions
):
Promise
<
IRawRequestFunction
>
{
const
endpoint
=
parseUrl
(
options
.
url
);
const
endpoint
=
parseUrl
(
options
.
url
!
);
const
module
=
endpoint
.
protocol
===
'
https:
'
?
await
import
(
'
https
'
)
:
await
import
(
'
http
'
);
return
module
.
request
;
}
...
...
@@ -64,7 +64,7 @@ export function request(options: IRequestOptions, token: CancellationToken): Pro
return
rawRequestPromise
.
then
(
rawRequest
=>
{
return
new
Promise
<
IRequestContext
>
((
c
,
e
)
=>
{
const
endpoint
=
parseUrl
(
options
.
url
);
const
endpoint
=
parseUrl
(
options
.
url
!
);
const
opts
:
https
.
RequestOptions
=
{
hostname
:
endpoint
.
hostname
,
...
...
@@ -82,8 +82,8 @@ export function request(options: IRequestOptions, token: CancellationToken): Pro
}
req
=
rawRequest
(
opts
,
(
res
:
http
.
ClientResponse
)
=>
{
const
followRedirects
=
isNumber
(
options
.
followRedirects
)
?
options
.
followRedirects
:
3
;
if
(
res
.
statusCode
>=
300
&&
res
.
statusCode
<
400
&&
followRedirects
>
0
&&
res
.
headers
[
'
location
'
])
{
const
followRedirects
:
number
=
isNumber
(
options
.
followRedirects
)
?
options
.
followRedirects
:
3
;
if
(
res
.
statusCode
&&
res
.
statusCode
>=
300
&&
res
.
statusCode
<
400
&&
followRedirects
>
0
&&
res
.
headers
[
'
location
'
])
{
request
(
assign
({},
options
,
{
url
:
res
.
headers
[
'
location
'
],
followRedirects
:
followRedirects
-
1
...
...
@@ -125,7 +125,7 @@ export function request(options: IRequestOptions, token: CancellationToken): Pro
}
function
isSuccess
(
context
:
IRequestContext
):
boolean
{
return
(
context
.
res
.
statusCode
>=
200
&&
context
.
res
.
statusCode
<
300
)
||
context
.
res
.
statusCode
===
1223
;
return
(
context
.
res
.
statusCode
&&
context
.
res
.
statusCode
>=
200
&&
context
.
res
.
statusCode
<
300
)
||
context
.
res
.
statusCode
===
1223
;
}
function
hasNoContent
(
context
:
IRequestContext
):
boolean
{
...
...
@@ -136,13 +136,13 @@ export function download(filePath: string, context: IRequestContext): Promise<vo
return
new
Promise
<
void
>
((
c
,
e
)
=>
{
const
out
=
createWriteStream
(
filePath
);
out
.
once
(
'
finish
'
,
()
=>
c
(
null
));
out
.
once
(
'
finish
'
,
()
=>
c
(
void
0
));
context
.
stream
.
once
(
'
error
'
,
e
);
context
.
stream
.
pipe
(
out
);
});
}
export
function
asText
(
context
:
IRequestContext
):
Promise
<
string
>
{
export
function
asText
(
context
:
IRequestContext
):
Promise
<
string
|
null
>
{
return
new
Promise
((
c
,
e
)
=>
{
if
(
!
isSuccess
(
context
))
{
return
e
(
'
Server returned
'
+
context
.
res
.
statusCode
);
...
...
@@ -159,7 +159,7 @@ export function asText(context: IRequestContext): Promise<string> {
});
}
export
function
asJson
<
T
>
(
context
:
IRequestContext
):
Promise
<
T
>
{
export
function
asJson
<
T
>
(
context
:
IRequestContext
):
Promise
<
T
|
null
>
{
return
new
Promise
((
c
,
e
)
=>
{
if
(
!
isSuccess
(
context
))
{
return
e
(
'
Server returned
'
+
context
.
res
.
statusCode
);
...
...
src/vs/editor/contrib/suggest/suggest.ts
浏览文件 @
fb606be7
...
...
@@ -81,7 +81,7 @@ export function provideSuggestionItems(
// for each support in the group ask for suggestions
return
Promise
.
all
(
supports
.
map
(
support
=>
{
if
(
!
isFalsyOrEmpty
(
onlyFrom
)
&&
onlyFrom
.
indexOf
(
support
)
<
0
)
{
if
(
!
isFalsyOrEmpty
(
onlyFrom
)
&&
onlyFrom
!
.
indexOf
(
support
)
<
0
)
{
return
undefined
;
}
...
...
src/vs/workbench/browser/part.ts
浏览文件 @
fb606be7
...
...
@@ -20,8 +20,8 @@ export interface IPartOptions {
*/
export
abstract
class
Part
extends
Component
{
private
parent
:
HTMLElement
;
private
titleArea
:
HTMLElement
;
private
contentArea
:
HTMLElement
;
private
titleArea
:
HTMLElement
|
null
;
private
contentArea
:
HTMLElement
|
null
;
private
partLayout
:
PartLayout
;
constructor
(
...
...
@@ -67,28 +67,28 @@ export abstract class Part extends Component {
/**
* Subclasses override to provide a title area implementation.
*/
protected
createTitleArea
(
parent
:
HTMLElement
):
HTMLElement
{
protected
createTitleArea
(
parent
:
HTMLElement
):
HTMLElement
|
null
{
return
null
;
}
/**
* Returns the title area container.
*/
protected
getTitleArea
():
HTMLElement
{
protected
getTitleArea
():
HTMLElement
|
null
{
return
this
.
titleArea
;
}
/**
* Subclasses override to provide a content area implementation.
*/
protected
createContentArea
(
parent
:
HTMLElement
):
HTMLElement
{
protected
createContentArea
(
parent
:
HTMLElement
):
HTMLElement
|
null
{
return
null
;
}
/**
* Returns the content area container.
*/
protected
getContentArea
():
HTMLElement
{
protected
getContentArea
():
HTMLElement
|
null
{
return
this
.
contentArea
;
}
...
...
@@ -104,7 +104,7 @@ export class PartLayout {
private
static
readonly
TITLE_HEIGHT
=
35
;
constructor
(
container
:
HTMLElement
,
private
options
:
IPartOptions
,
titleArea
:
HTMLElement
,
private
contentArea
:
HTMLElement
)
{
}
constructor
(
container
:
HTMLElement
,
private
options
:
IPartOptions
,
titleArea
:
HTMLElement
|
null
,
private
contentArea
:
HTMLElement
|
null
)
{
}
layout
(
dimension
:
Dimension
):
Dimension
[]
{
const
{
width
,
height
}
=
dimension
;
...
...
src/vs/workbench/parts/surveys/electron-browser/nps.contribution.ts
浏览文件 @
fb606be7
...
...
@@ -39,7 +39,7 @@ class NPSContribution implements IWorkbenchContribution {
return
;
}
const
sessionCount
=
storageService
.
getInteger
(
SESSION_COUNT_KEY
,
StorageScope
.
GLOBAL
,
0
)
+
1
;
const
sessionCount
=
(
storageService
.
getInteger
(
SESSION_COUNT_KEY
,
StorageScope
.
GLOBAL
,
0
)
||
0
)
+
1
;
storageService
.
store
(
LAST_SESSION_DATE_KEY
,
date
,
StorageScope
.
GLOBAL
);
storageService
.
store
(
SESSION_COUNT_KEY
,
sessionCount
,
StorageScope
.
GLOBAL
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录