Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
20acc5ec
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,发现更多精彩内容 >>
提交
20acc5ec
编写于
4月 16, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#43645 Prepare for activity groups contribution
上级
6c223050
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
28 deletion
+26
-28
src/vs/workbench/api/browser/viewsExtensionPoint.ts
src/vs/workbench/api/browser/viewsExtensionPoint.ts
+10
-7
src/vs/workbench/browser/parts/views/viewsViewlet.ts
src/vs/workbench/browser/parts/views/viewsViewlet.ts
+1
-1
src/vs/workbench/common/views.ts
src/vs/workbench/common/views.ts
+14
-15
src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts
...vs/workbench/parts/quickopen/browser/viewPickerHandler.ts
+1
-5
未找到文件。
src/vs/workbench/api/browser/viewsExtensionPoint.ts
浏览文件 @
20acc5ec
...
...
@@ -83,6 +83,14 @@ namespace schema {
};
}
function
getViewLocation
(
value
:
string
):
ViewLocation
{
switch
(
value
)
{
case
'
explorer
'
:
return
ViewLocation
.
Explorer
;
case
'
debug
'
:
return
ViewLocation
.
Debug
;
default
:
return
ViewLocation
.
get
(
`workbench.view.extension.
${
value
}
`
)
||
ViewLocation
.
Explorer
;
}
}
ExtensionsRegistry
.
registerExtensionPoint
<
{
[
loc
:
string
]:
schema
.
IUserFriendlyViewDescriptor
[]
}
>
(
'
views
'
,
[],
schema
.
viewsContribution
)
.
setHandler
((
extensions
)
=>
{
for
(
let
extension
of
extensions
)
{
...
...
@@ -93,12 +101,7 @@ ExtensionsRegistry.registerExtensionPoint<{ [loc: string]: schema.IUserFriendlyV
return
;
}
const
location
=
ViewLocation
.
getContributedViewLocation
(
entry
.
key
);
if
(
!
location
)
{
collector
.
warn
(
localize
(
'
locationId.invalid
'
,
"
`{0}` is not a valid view location
"
,
entry
.
key
));
return
;
}
const
location
=
getViewLocation
(
entry
.
key
);
const
registeredViews
=
ViewsRegistry
.
getViews
(
location
);
const
viewIds
=
[];
const
viewDescriptors
=
coalesce
(
entry
.
value
.
map
(
item
=>
{
...
...
@@ -129,4 +132,4 @@ ExtensionsRegistry.registerExtensionPoint<{ [loc: string]: schema.IUserFriendlyV
ViewsRegistry
.
registerViews
(
viewDescriptors
);
});
}
});
});
\ No newline at end of file
src/vs/workbench/browser/parts/views/viewsViewlet.ts
浏览文件 @
20acc5ec
...
...
@@ -544,7 +544,7 @@ export class ViewsViewlet extends PanelViewlet implements IViewsViewlet {
return
false
;
}
if
(
ViewLocation
.
get
ContributedViewLocation
(
this
.
location
.
id
))
{
if
(
ViewLocation
.
get
(
this
.
location
.
id
))
{
let
visibleViewsCount
=
0
;
if
(
this
.
areExtensionsReady
)
{
visibleViewsCount
=
this
.
getViewDescriptorsFromRegistry
().
reduce
((
visibleViewsCount
,
v
)
=>
visibleViewsCount
+
(
this
.
canBeVisible
(
v
)
?
1
:
0
),
0
);
...
...
src/vs/workbench/common/views.ts
浏览文件 @
20acc5ec
...
...
@@ -17,24 +17,23 @@ import { ThemeIcon } from 'vs/platform/theme/common/themeService';
export
class
ViewLocation
{
static
readonly
Explorer
=
new
ViewLocation
(
'
workbench.view.explorer
'
);
static
re
adonly
Debug
=
new
ViewLocation
(
'
workbench.view.debug
'
);
static
readonly
Extensions
=
new
ViewLocation
(
'
workbench.view.extensions
'
);
constructor
(
private
_id
:
string
)
{
private
static
locations
:
Map
<
string
,
ViewLocation
>
=
new
Map
<
string
,
ViewLocation
>
(
);
static
re
gister
(
id
:
string
):
ViewLocation
{
const
viewLocation
=
new
ViewLocation
(
id
);
ViewLocation
.
locations
.
set
(
id
,
viewLocation
);
return
viewLocation
;
}
get
id
():
string
{
return
this
.
_id
;
static
get
(
value
:
string
):
ViewLocation
{
return
ViewLocation
.
locations
.
get
(
value
);
}
static
getContributedViewLocation
(
value
:
string
):
ViewLocation
{
switch
(
value
)
{
case
'
explorer
'
:
return
ViewLocation
.
Explorer
;
case
'
debug
'
:
return
ViewLocation
.
Debug
;
}
return
void
0
;
}
static
readonly
Explorer
:
ViewLocation
=
ViewLocation
.
register
(
'
workbench.view.explorer
'
);
static
readonly
Debug
:
ViewLocation
=
ViewLocation
.
register
(
'
workbench.view.debug
'
);
static
readonly
Extensions
:
ViewLocation
=
ViewLocation
.
register
(
'
workbench.view.extensions
'
)
;
private
constructor
(
private
_id
:
string
)
{
}
get
id
():
string
{
return
this
.
_id
;
}
}
export
interface
IViewDescriptor
{
...
...
src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts
浏览文件 @
20acc5ec
...
...
@@ -146,11 +146,7 @@ export class ViewPickerHandler extends QuickOpenHandler {
// Views
viewlets
.
forEach
((
viewlet
,
index
)
=>
{
const
viewLocation
:
ViewLocation
=
viewlet
.
id
===
EXPLORER_VIEWLET_ID
?
ViewLocation
.
Explorer
:
viewlet
.
id
===
DEBUG_VIEWLET_ID
?
ViewLocation
.
Debug
:
viewlet
.
id
===
EXTENSIONS_VIEWLET_ID
?
ViewLocation
.
Extensions
:
null
;
const
viewLocation
:
ViewLocation
=
ViewLocation
.
get
(
viewlet
.
id
);
if
(
viewLocation
)
{
const
viewEntriesForViewlet
:
ViewEntry
[]
=
getViewEntriesForViewlet
(
viewlet
,
viewLocation
);
viewEntries
.
push
(...
viewEntriesForViewlet
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录