Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
fa93b07d
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(gitcode.net)2024年7月9日维护升级公告
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
fa93b07d
编写于
3月 08, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#49054 Do not hide in built viewlets
上级
53c5277f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
12 deletion
+10
-12
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
...vs/workbench/browser/parts/activitybar/activitybarPart.ts
+6
-9
src/vs/workbench/common/views.ts
src/vs/workbench/common/views.ts
+4
-3
未找到文件。
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
浏览文件 @
fa93b07d
...
...
@@ -34,8 +34,6 @@ import { isUndefinedOrNull } from 'vs/base/common/types';
import
{
IActivityBarService
}
from
'
vs/workbench/services/activityBar/browser/activityBarService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
const
SCM_VIEWLET_ID
=
'
workbench.view.scm
'
;
interface
ICachedViewlet
{
id
:
string
;
iconUrl
?:
UriComponents
;
...
...
@@ -136,7 +134,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
for
(
const
viewlet
of
this
.
viewletService
.
getViewlets
())
{
this
.
enableCompositeActions
(
viewlet
);
const
viewContainer
=
this
.
getViewContainer
(
viewlet
.
id
);
if
(
viewContainer
)
{
if
(
viewContainer
&&
viewContainer
.
hideIfEmpty
)
{
const
viewDescriptors
=
this
.
viewsService
.
getViewDescriptors
(
viewContainer
);
if
(
viewDescriptors
)
{
this
.
onDidChangeActiveViews
(
viewlet
,
viewDescriptors
);
...
...
@@ -167,7 +165,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
const
viewletDescriptor
=
this
.
viewletService
.
getViewlet
(
viewlet
.
getId
());
if
(
viewletDescriptor
)
{
const
viewContainer
=
this
.
getViewContainer
(
viewletDescriptor
.
id
);
if
(
viewContainer
)
{
if
(
viewContainer
&&
viewContainer
.
hideIfEmpty
)
{
const
viewDescriptors
=
this
.
viewsService
.
getViewDescriptors
(
viewContainer
);
if
(
viewDescriptors
&&
viewDescriptors
.
activeViewDescriptors
.
length
===
0
)
{
this
.
removeComposite
(
viewletDescriptor
.
id
,
true
);
// Update the composite bar by hiding
...
...
@@ -313,6 +311,10 @@ export class ActivitybarPart extends Part implements IActivityBarService {
}
private
shouldBeHidden
(
viewletId
:
string
,
cachedViewlet
:
ICachedViewlet
):
boolean
{
const
viewContainer
=
this
.
getViewContainer
(
viewletId
);
if
(
!
viewContainer
||
!
viewContainer
.
hideIfEmpty
)
{
return
false
;
}
return
cachedViewlet
&&
cachedViewlet
.
views
&&
cachedViewlet
.
views
.
length
?
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 */
;
...
...
@@ -488,11 +490,6 @@ export class ActivitybarPart extends Part implements IActivityBarService {
}
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
undefined
;
}
const
viewContainerRegistry
=
Registry
.
as
<
IViewContainersRegistry
>
(
ViewContainerExtensions
.
ViewContainersRegistry
);
return
viewContainerRegistry
.
get
(
viewletId
);
}
...
...
src/vs/workbench/common/views.ts
浏览文件 @
fa93b07d
...
...
@@ -67,7 +67,7 @@ export interface IViewContainersRegistry {
}
export
class
ViewContainer
{
protected
constructor
(
readonly
id
:
string
,
readonly
extensionId
:
ExtensionIdentifier
)
{
}
protected
constructor
(
readonly
id
:
string
,
readonly
hideIfEmpty
:
boolean
,
readonly
extensionId
?
:
ExtensionIdentifier
)
{
}
}
class
ViewContainersRegistryImpl
implements
IViewContainersRegistry
{
...
...
@@ -84,15 +84,16 @@ class ViewContainersRegistryImpl implements IViewContainersRegistry {
return
values
(
this
.
viewContainers
);
}
registerViewContainer
(
id
:
string
,
extensionId
:
ExtensionIdentifier
):
ViewContainer
{
registerViewContainer
(
id
:
string
,
extensionId
?
:
ExtensionIdentifier
):
ViewContainer
{
const
existing
=
this
.
viewContainers
.
get
(
id
);
if
(
existing
)
{
return
existing
;
}
const
hideIfEmpty
=
id
===
TEST_VIEW_CONTAINER_ID
||
!!
extensionId
;
const
viewContainer
=
new
class
extends
ViewContainer
{
constructor
()
{
super
(
id
,
extensionId
);
super
(
id
,
hideIfEmpty
,
extensionId
);
}
};
this
.
viewContainers
.
set
(
id
,
viewContainer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录