Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
49607e57
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,发现更多精彩内容 >>
提交
49607e57
编写于
1月 10, 2019
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
strict null - Map.get(K) can return undefined
上级
ed0057fd
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
15 addition
and
15 deletion
+15
-15
src/typings/lib.ie11_safe_es6.d.ts
src/typings/lib.ie11_safe_es6.d.ts
+1
-1
src/vs/editor/contrib/snippet/snippetSession.ts
src/vs/editor/contrib/snippet/snippetSession.ts
+5
-5
src/vs/workbench/browser/parts/views/views.ts
src/vs/workbench/browser/parts/views/views.ts
+4
-4
src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts
...bench/parts/extensions/node/extensionsWorkbenchService.ts
+1
-1
src/vs/workbench/services/search/node/fileSearch.ts
src/vs/workbench/services/search/node/fileSearch.ts
+4
-4
未找到文件。
src/typings/lib.ie11_safe_es6.d.ts
浏览文件 @
49607e57
...
...
@@ -10,7 +10,7 @@ interface Map<K, V> {
clear
():
void
;
delete
(
key
:
K
):
boolean
;
forEach
(
callbackfn
:
(
value
:
V
,
index
:
K
,
map
:
Map
<
K
,
V
>
)
=>
void
,
thisArg
?:
any
):
void
;
get
(
key
:
K
):
V
;
get
(
key
:
K
):
V
|
undefined
;
has
(
key
:
K
):
boolean
;
set
(
key
:
K
,
value
?:
V
):
Map
<
K
,
V
>
;
readonly
size
:
number
;
...
...
src/vs/editor/contrib/snippet/snippetSession.ts
浏览文件 @
49607e57
...
...
@@ -108,7 +108,7 @@ export class OneSnippet {
for
(
const
placeholder
of
this
.
_placeholderGroups
[
this
.
_placeholderGroupsIdx
])
{
// Check if the placeholder has a transformation
if
(
placeholder
.
transform
)
{
const
id
=
this
.
_placeholderDecorations
.
get
(
placeholder
);
const
id
=
this
.
_placeholderDecorations
.
get
(
placeholder
)
!
;
const
range
=
this
.
_editor
.
getModel
().
getDecorationRange
(
id
)
!
;
const
currentValue
=
this
.
_editor
.
getModel
().
getValueInRange
(
range
);
...
...
@@ -158,7 +158,7 @@ export class OneSnippet {
activePlaceholders
.
add
(
placeholder
);
for
(
const
enclosingPlaceholder
of
this
.
_snippet
.
enclosingPlaceholders
(
placeholder
))
{
const
id
=
this
.
_placeholderDecorations
.
get
(
enclosingPlaceholder
);
const
id
=
this
.
_placeholderDecorations
.
get
(
enclosingPlaceholder
)
!
;
accessor
.
changeDecorationOptions
(
id
,
enclosingPlaceholder
.
isFinalTabstop
?
OneSnippet
.
_decor
.
activeFinal
:
OneSnippet
.
_decor
.
active
);
activePlaceholders
.
add
(
enclosingPlaceholder
);
}
...
...
@@ -206,7 +206,7 @@ export class OneSnippet {
result
.
set
(
placeholder
.
index
,
ranges
);
}
const
id
=
this
.
_placeholderDecorations
.
get
(
placeholder
);
const
id
=
this
.
_placeholderDecorations
.
get
(
placeholder
)
!
;
const
range
=
this
.
_editor
.
getModel
().
getDecorationRange
(
id
);
if
(
!
range
)
{
// one of the placeholder lost its decoration and
...
...
@@ -257,7 +257,7 @@ export class OneSnippet {
// Remove the placeholder at which position are inserting
// the snippet and also remove its decoration.
const
id
=
this
.
_placeholderDecorations
.
get
(
placeholder
);
const
id
=
this
.
_placeholderDecorations
.
get
(
placeholder
)
!
;
accessor
.
removeDecoration
(
id
);
this
.
_placeholderDecorations
.
delete
(
placeholder
);
...
...
@@ -574,7 +574,7 @@ export class SnippetSession {
// add selections from 'this' snippet so that we know all
// selections for this placeholder
allPossibleSelections
.
forEach
((
array
,
index
)
=>
{
array
.
push
(...
possibleSelections
.
get
(
index
));
array
.
push
(...
possibleSelections
.
get
(
index
)
!
);
});
}
...
...
src/vs/workbench/browser/parts/views/views.ts
浏览文件 @
49607e57
...
...
@@ -204,7 +204,7 @@ export class ContributableViewsModel extends Disposable {
readonly
viewDescriptors
:
IViewDescriptor
[]
=
[];
get
visibleViewDescriptors
():
IViewDescriptor
[]
{
return
this
.
viewDescriptors
.
filter
(
v
=>
this
.
viewStates
.
get
(
v
.
id
).
visible
);
return
this
.
viewDescriptors
.
filter
(
v
=>
this
.
viewStates
.
get
(
v
.
id
)
!
.
visible
);
}
private
_onDidAdd
=
this
.
_register
(
new
Emitter
<
IAddedViewDescriptorRef
[]
>
());
...
...
@@ -298,7 +298,7 @@ export class ContributableViewsModel extends Disposable {
move
(
this
.
viewDescriptors
,
fromIndex
,
toIndex
);
for
(
let
index
=
0
;
index
<
this
.
viewDescriptors
.
length
;
index
++
)
{
const
state
=
this
.
viewStates
.
get
(
this
.
viewDescriptors
[
index
].
id
);
const
state
=
this
.
viewStates
.
get
(
this
.
viewDescriptors
[
index
].
id
)
!
;
state
.
order
=
index
;
}
...
...
@@ -388,7 +388,7 @@ export class ContributableViewsModel extends Disposable {
}
for
(
const
viewDescriptor
of
splice
.
toInsert
)
{
const
state
=
this
.
viewStates
.
get
(
viewDescriptor
.
id
);
const
state
=
this
.
viewStates
.
get
(
viewDescriptor
.
id
)
!
;
if
(
state
.
visible
)
{
toAdd
.
push
({
index
:
startIndex
++
,
viewDescriptor
,
size
:
state
.
size
,
collapsed
:
state
.
collapsed
});
...
...
@@ -536,7 +536,7 @@ export class ViewsService extends Disposable implements IViewsService {
}
getViewDescriptors
(
container
:
ViewContainer
):
IViewDescriptorCollection
{
return
this
.
viewDescriptorCollections
.
get
(
container
);
return
this
.
viewDescriptorCollections
.
get
(
container
)
!
;
}
openView
(
id
:
string
,
focus
:
boolean
):
Promise
<
IView
|
null
>
{
...
...
src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts
浏览文件 @
49607e57
...
...
@@ -341,7 +341,7 @@ class ExtensionDependencies implements IExtensionDependencies {
if
(
!
this
.
hasDependencies
)
{
return
[];
}
return
this
.
_extension
.
dependencies
.
map
(
id
=>
new
ExtensionDependencies
(
this
.
_map
.
get
(
id
),
id
,
this
.
_map
,
this
));
return
this
.
_extension
.
dependencies
.
map
(
id
=>
new
ExtensionDependencies
(
this
.
_map
.
get
(
id
)
!
,
id
,
this
.
_map
,
this
));
}
private
computeHasDependencies
():
boolean
{
...
...
src/vs/workbench/services/search/node/fileSearch.ts
浏览文件 @
49607e57
...
...
@@ -203,7 +203,7 @@ export class FileWalker {
const
useRipgrep
=
this
.
useRipgrep
;
let
noSiblingsClauses
:
boolean
;
if
(
useRipgrep
)
{
const
ripgrep
=
spawnRipgrepCmd
(
this
.
config
,
folderQuery
,
this
.
config
.
includePattern
,
this
.
folderExcludePatterns
.
get
(
folderQuery
.
folder
.
fsPath
).
expression
);
const
ripgrep
=
spawnRipgrepCmd
(
this
.
config
,
folderQuery
,
this
.
config
.
includePattern
,
this
.
folderExcludePatterns
.
get
(
folderQuery
.
folder
.
fsPath
)
!
.
expression
);
cmd
=
ripgrep
.
cmd
;
noSiblingsClauses
=
!
Object
.
keys
(
ripgrep
.
siblingClauses
).
length
;
...
...
@@ -286,7 +286,7 @@ export class FileWalker {
* Public for testing.
*/
spawnFindCmd
(
folderQuery
:
IFolderQuery
)
{
const
excludePattern
=
this
.
folderExcludePatterns
.
get
(
folderQuery
.
folder
.
fsPath
);
const
excludePattern
=
this
.
folderExcludePatterns
.
get
(
folderQuery
.
folder
.
fsPath
)
!
;
const
basenames
=
excludePattern
.
getBasenameTerms
();
const
pathTerms
=
excludePattern
.
getPathTerms
();
const
args
=
[
'
-L
'
,
'
.
'
];
...
...
@@ -428,7 +428,7 @@ export class FileWalker {
private
matchDirectoryTree
({
rootEntries
,
pathToEntries
}:
IDirectoryTree
,
rootFolder
:
string
,
onResult
:
(
result
:
IRawFileMatch
)
=>
void
)
{
const
self
=
this
;
const
excludePattern
=
this
.
folderExcludePatterns
.
get
(
rootFolder
);
const
excludePattern
=
this
.
folderExcludePatterns
.
get
(
rootFolder
)
!
;
const
filePattern
=
this
.
filePattern
;
function
matchDirectory
(
entries
:
IDirectoryEntry
[])
{
self
.
directoriesWalked
++
;
...
...
@@ -508,7 +508,7 @@ export class FileWalker {
// to ignore filtering by siblings because the user seems to know what she
// is searching for and we want to include the result in that case anyway
const
currentRelativePath
=
relativeParentPath
?
[
relativeParentPath
,
file
].
join
(
path
.
sep
)
:
file
;
if
(
this
.
folderExcludePatterns
.
get
(
folderQuery
.
folder
.
fsPath
).
test
(
currentRelativePath
,
file
,
this
.
config
.
filePattern
!==
file
?
hasSibling
:
undefined
))
{
if
(
this
.
folderExcludePatterns
.
get
(
folderQuery
.
folder
.
fsPath
)
!
.
test
(
currentRelativePath
,
file
,
this
.
config
.
filePattern
!==
file
?
hasSibling
:
undefined
))
{
return
clb
(
null
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录