Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
bdc94795
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,发现更多精彩内容 >>
提交
bdc94795
编写于
11月 08, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null check storageService
上级
ba97287c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
7 deletion
+12
-7
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+2
-0
src/vs/platform/storage/node/storageService.ts
src/vs/platform/storage/node/storageService.ts
+10
-7
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
bdc94795
...
...
@@ -446,6 +446,7 @@
"./vs/platform/integrity/common/integrity.ts"
,
"./vs/platform/integrity/node/integrityServiceImpl.ts"
,
"./vs/platform/issue/common/issue.ts"
,
"./vs/platform/issue/electron-main/issueService.ts"
,
"./vs/platform/issue/node/issueIpc.ts"
,
"./vs/platform/jsonschemas/common/jsonContributionRegistry.ts"
,
"./vs/platform/keybinding/common/abstractKeybindingService.ts"
,
...
...
@@ -499,6 +500,7 @@
"./vs/platform/statusbar/common/statusbar.ts"
,
"./vs/platform/storage/common/storage.ts"
,
"./vs/platform/storage/common/storageLegacyService.ts"
,
"./vs/platform/storage/node/storageService.ts"
,
"./vs/platform/telemetry/browser/errorTelemetry.ts"
,
"./vs/platform/telemetry/common/telemetry.ts"
,
"./vs/platform/telemetry/common/telemetryService.ts"
,
...
...
src/vs/platform/storage/node/storageService.ts
浏览文件 @
bdc94795
...
...
@@ -33,7 +33,7 @@ export class StorageService extends Disposable implements IStorageService {
private
_hasErrors
=
false
;
get
hasErrors
():
boolean
{
return
this
.
_hasErrors
;
}
private
bufferedStorageErrors
:
(
string
|
Error
)[]
=
[];
private
bufferedStorageErrors
?
:
(
string
|
Error
)[]
=
[];
private
_onStorageError
:
Emitter
<
string
|
Error
>
=
this
.
_register
(
new
Emitter
<
string
|
Error
>
());
get
onStorageError
():
Event
<
string
|
Error
>
{
if
(
Array
.
isArray
(
this
.
bufferedStorageErrors
))
{
...
...
@@ -199,7 +199,7 @@ export class StorageService extends Disposable implements IStorageService {
});
console
.
group
(
`Storage: Global (integrity:
${
result
[
2
]}
, load:
${
getDuration
(
'
willInitGlobalStorage
'
,
'
didInitGlobalStorage
'
)}
, path:
${
this
.
globalStorageWorkspacePath
}
)`
);
let
globalValues
=
[];
let
globalValues
:
{
key
:
string
,
value
:
string
}[]
=
[];
globalItems
.
forEach
((
value
,
key
)
=>
{
globalValues
.
push
({
key
,
value
});
});
...
...
@@ -209,7 +209,7 @@ export class StorageService extends Disposable implements IStorageService {
console
.
log
(
globalItemsParsed
);
console
.
group
(
`Storage: Workspace (integrity:
${
result
[
3
]}
, load:
${
getDuration
(
'
willInitWorkspaceStorage
'
,
'
didInitWorkspaceStorage
'
)}
, path:
${
this
.
workspaceStoragePath
}
)`
);
let
workspaceValues
=
[];
let
workspaceValues
:
{
key
:
string
,
value
:
string
}[]
=
[];
workspaceItems
.
forEach
((
value
,
key
)
=>
{
workspaceValues
.
push
({
key
,
value
});
});
...
...
@@ -295,7 +295,7 @@ export class DelegatingStorageService extends Disposable implements IStorageServ
const
globalKeyMarker
=
'
storage://global/
'
;
window
.
addEventListener
(
'
storage
'
,
e
=>
{
if
(
startsWith
(
e
.
key
,
globalKeyMarker
))
{
if
(
e
.
key
&&
startsWith
(
e
.
key
,
globalKeyMarker
))
{
const
key
=
e
.
key
.
substr
(
globalKeyMarker
.
length
);
this
.
_onDidChangeStorage
.
fire
({
key
,
scope
:
StorageScope
.
GLOBAL
});
...
...
@@ -307,7 +307,8 @@ export class DelegatingStorageService extends Disposable implements IStorageServ
return
this
.
storageService
as
StorageService
;
}
get
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
string
):
string
{
get
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
:
string
):
string
;
get
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
string
):
string
|
undefined
{
if
(
scope
===
StorageScope
.
WORKSPACE
&&
!
this
.
useLegacyWorkspaceStorage
)
{
return
this
.
storageService
.
get
(
key
,
scope
,
fallbackValue
);
}
...
...
@@ -315,7 +316,8 @@ export class DelegatingStorageService extends Disposable implements IStorageServ
return
this
.
storageLegacyService
.
get
(
key
,
this
.
convertScope
(
scope
),
fallbackValue
);
}
getBoolean
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
boolean
):
boolean
{
getBoolean
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
:
boolean
):
boolean
;
getBoolean
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
boolean
):
boolean
|
undefined
{
if
(
scope
===
StorageScope
.
WORKSPACE
&&
!
this
.
useLegacyWorkspaceStorage
)
{
return
this
.
storageService
.
getBoolean
(
key
,
scope
,
fallbackValue
);
}
...
...
@@ -323,7 +325,8 @@ export class DelegatingStorageService extends Disposable implements IStorageServ
return
this
.
storageLegacyService
.
getBoolean
(
key
,
this
.
convertScope
(
scope
),
fallbackValue
);
}
getInteger
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
number
):
number
{
getInteger
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
:
number
):
number
;
getInteger
(
key
:
string
,
scope
:
StorageScope
,
fallbackValue
?:
number
):
number
|
undefined
{
if
(
scope
===
StorageScope
.
WORKSPACE
&&
!
this
.
useLegacyWorkspaceStorage
)
{
return
this
.
storageService
.
getInteger
(
key
,
scope
,
fallbackValue
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录