Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
aa912c88
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,发现更多精彩内容 >>
提交
aa912c88
编写于
3月 04, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null check activityBar
上级
84c059ab
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
26 deletion
+32
-26
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+1
-0
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
...vs/workbench/browser/parts/activitybar/activitybarPart.ts
+20
-15
src/vs/workbench/browser/parts/compositeBar.ts
src/vs/workbench/browser/parts/compositeBar.ts
+3
-3
src/vs/workbench/browser/parts/compositeBarActions.ts
src/vs/workbench/browser/parts/compositeBarActions.ts
+8
-8
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
aa912c88
...
...
@@ -104,6 +104,7 @@
"./vs/workbench/browser/panel.ts"
,
"./vs/workbench/browser/part.ts"
,
"./vs/workbench/browser/parts/activitybar/activitybarActions.ts"
,
"./vs/workbench/browser/parts/activitybar/activitybarPart.ts"
,
"./vs/workbench/browser/parts/compositeBar.ts"
,
"./vs/workbench/browser/parts/compositeBarActions.ts"
,
"./vs/workbench/browser/parts/compositePart.ts"
,
...
...
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
浏览文件 @
aa912c88
...
...
@@ -38,11 +38,11 @@ const SCM_VIEWLET_ID = 'workbench.view.scm';
interface
ICachedViewlet
{
id
:
string
;
iconUrl
:
UriComponents
;
iconUrl
?
:
UriComponents
;
pinned
:
boolean
;
order
:
number
;
order
?
:
number
;
visible
:
boolean
;
views
?:
{
when
:
string
}[];
views
?:
{
when
?
:
string
}[];
}
export
class
ActivitybarPart
extends
Part
implements
ISerializableView
{
...
...
@@ -161,14 +161,19 @@ export class ActivitybarPart extends Part implements ISerializableView {
private
onDidViewletOpen
(
viewlet
:
IViewlet
):
void
{
// Update the composite bar by adding
this
.
compositeBar
.
addComposite
(
this
.
viewletService
.
getViewlet
(
viewlet
.
getId
()));
const
foundViewlet
=
this
.
viewletService
.
getViewlet
(
viewlet
.
getId
());
if
(
foundViewlet
)
{
this
.
compositeBar
.
addComposite
(
foundViewlet
);
}
this
.
compositeBar
.
activateComposite
(
viewlet
.
getId
());
const
viewletDescriptor
=
this
.
viewletService
.
getViewlet
(
viewlet
.
getId
());
const
viewContainer
=
this
.
getViewContainer
(
viewletDescriptor
.
id
);
if
(
viewContainer
)
{
const
viewDescriptors
=
this
.
viewsService
.
getViewDescriptors
(
viewContainer
);
if
(
viewDescriptors
&&
viewDescriptors
.
activeViewDescriptors
.
length
===
0
)
{
this
.
removeComposite
(
viewletDescriptor
.
id
,
true
);
// Update the composite bar by hiding
if
(
viewletDescriptor
)
{
const
viewContainer
=
this
.
getViewContainer
(
viewletDescriptor
.
id
);
if
(
viewContainer
)
{
const
viewDescriptors
=
this
.
viewsService
.
getViewDescriptors
(
viewContainer
);
if
(
viewDescriptors
&&
viewDescriptors
.
activeViewDescriptors
.
length
===
0
)
{
this
.
removeComposite
(
viewletDescriptor
.
id
,
true
);
// Update the composite bar by hiding
}
}
}
}
...
...
@@ -241,7 +246,7 @@ export class ActivitybarPart extends Part implements ISerializableView {
badgeBackground
:
theme
.
getColor
(
ACTIVITY_BAR_BADGE_BACKGROUND
),
badgeForeground
:
theme
.
getColor
(
ACTIVITY_BAR_BADGE_FOREGROUND
),
dragAndDropBackground
:
theme
.
getColor
(
ACTIVITY_BAR_DRAG_AND_DROP_BACKGROUND
),
activeBackgroundColor
:
null
,
inactiveBackgroundColor
:
null
,
activeBorderBottomColor
:
null
,
activeBackgroundColor
:
undefined
,
inactiveBackgroundColor
:
undefined
,
activeBorderBottomColor
:
undefined
,
};
}
...
...
@@ -311,7 +316,7 @@ export class ActivitybarPart extends Part implements ISerializableView {
private
shouldBeHidden
(
viewletId
:
string
,
cachedViewlet
:
ICachedViewlet
):
boolean
{
return
cachedViewlet
&&
cachedViewlet
.
views
&&
cachedViewlet
.
views
.
length
?
cachedViewlet
.
views
.
every
(({
when
})
=>
when
&&
!
this
.
contextKeyService
.
contextMatchesRules
(
ContextKeyExpr
.
deserialize
(
when
)))
?
cachedViewlet
.
views
.
every
(({
when
})
=>
!!
when
&&
!
this
.
contextKeyService
.
contextMatchesRules
(
ContextKeyExpr
.
deserialize
(
when
)))
:
viewletId
===
TEST_VIEW_CONTAINER_ID
/* Hide Test viewlet for the first time or it had no views registered before */
;
}
...
...
@@ -371,7 +376,7 @@ export class ActivitybarPart extends Part implements ISerializableView {
}
// Pass to super
const
sizes
=
super
.
layout
(
dim1
instanceof
Dimension
?
dim1
:
new
Dimension
(
dim1
,
dim2
));
const
sizes
=
super
.
layout
(
dim1
instanceof
Dimension
?
dim1
:
new
Dimension
(
dim1
,
dim2
!
));
this
.
dimension
=
sizes
[
1
];
...
...
@@ -428,7 +433,7 @@ export class ActivitybarPart extends Part implements ISerializableView {
const
viewContainer
=
this
.
getViewContainer
(
compositeItem
.
id
);
const
viewlet
=
allViewlets
.
filter
(({
id
})
=>
id
===
compositeItem
.
id
)[
0
];
if
(
viewlet
)
{
const
views
:
{
when
:
string
}[]
=
[];
const
views
:
{
when
:
string
|
undefined
}[]
=
[];
if
(
viewContainer
)
{
const
viewDescriptors
=
this
.
viewsService
.
getViewDescriptors
(
viewContainer
);
if
(
viewDescriptors
)
{
...
...
@@ -471,7 +476,7 @@ export class ActivitybarPart extends Part implements ISerializableView {
return
result
;
}
private
_cachedViewletsValue
:
string
;
private
_cachedViewletsValue
:
string
|
null
;
private
get
cachedViewletsValue
():
string
{
if
(
!
this
.
_cachedViewletsValue
)
{
this
.
_cachedViewletsValue
=
this
.
getStoredCachedViewletsValue
();
...
...
@@ -498,7 +503,7 @@ export class ActivitybarPart extends Part implements ISerializableView {
private
getViewContainer
(
viewletId
:
string
):
ViewContainer
|
undefined
{
// TODO: @Joao Remove this after moving SCM Viewlet to ViewContainerViewlet - https://github.com/Microsoft/vscode/issues/49054
if
(
viewletId
===
SCM_VIEWLET_ID
)
{
return
null
;
return
undefined
;
}
const
viewContainerRegistry
=
Registry
.
as
<
IViewContainersRegistry
>
(
ViewContainerExtensions
.
ViewContainersRegistry
);
...
...
src/vs/workbench/browser/parts/compositeBar.ts
浏览文件 @
aa912c88
...
...
@@ -23,7 +23,7 @@ import { Emitter, Event } from 'vs/base/common/event';
export
interface
ICompositeBarItem
{
id
:
string
;
name
:
string
;
name
?
:
string
;
pinned
:
boolean
;
order
?:
number
;
visible
:
boolean
;
...
...
@@ -404,7 +404,7 @@ export class CompositeBar extends Widget implements ICompositeBar {
this
.
_onDidChange
.
fire
();
}
private
getOverflowingComposites
():
{
id
:
string
,
name
:
string
}[]
{
private
getOverflowingComposites
():
{
id
:
string
,
name
?
:
string
}[]
{
let
overflowingIds
=
this
.
model
.
visibleItems
.
filter
(
item
=>
item
.
pinned
).
map
(
item
=>
item
.
id
);
// Show the active composite even if it is not pinned
...
...
@@ -513,7 +513,7 @@ class CompositeBarModel {
return
this
.
items
.
filter
(
item
=>
item
.
visible
&&
item
.
pinned
);
}
private
createCompositeBarItem
(
id
:
string
,
name
:
string
,
order
:
number
|
undefined
,
pinned
:
boolean
,
visible
:
boolean
):
ICompositeBarModelItem
{
private
createCompositeBarItem
(
id
:
string
,
name
:
string
|
undefined
,
order
:
number
|
undefined
,
pinned
:
boolean
,
visible
:
boolean
):
ICompositeBarModelItem
{
const
options
=
this
.
options
;
return
{
id
,
name
,
pinned
,
order
,
visible
,
...
...
src/vs/workbench/browser/parts/compositeBarActions.ts
浏览文件 @
aa912c88
...
...
@@ -108,14 +108,14 @@ export class ActivityAction extends Action {
}
export
interface
ICompositeBarColors
{
activeBackgroundColor
:
Color
;
inactiveBackgroundColor
:
Color
;
activeBorderBottomColor
:
Color
;
activeForegroundColor
:
Color
;
inactiveForegroundColor
:
Color
;
badgeBackground
:
Color
;
badgeForeground
:
Color
;
dragAndDropBackground
:
Color
;
activeBackgroundColor
?
:
Color
;
inactiveBackgroundColor
?
:
Color
;
activeBorderBottomColor
?
:
Color
;
activeForegroundColor
?
:
Color
;
inactiveForegroundColor
?
:
Color
;
badgeBackground
?
:
Color
;
badgeForeground
?
:
Color
;
dragAndDropBackground
?
:
Color
;
}
export
interface
IActivityActionItemOptions
extends
IBaseActionItemOptions
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录