Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6793e088
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,发现更多精彩内容 >>
提交
6793e088
编写于
11月 08, 2016
作者:
P
Pine Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove awkward workaround for extension viewletid
上级
e2b7b520
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
14 addition
and
40 deletion
+14
-40
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
...vs/workbench/browser/parts/activitybar/activitybarPart.ts
+1
-20
src/vs/workbench/browser/viewlet.ts
src/vs/workbench/browser/viewlet.ts
+4
-0
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+3
-8
src/vs/workbench/parts/explorers/browser/treeExplorerViewlet.ts
.../workbench/parts/explorers/browser/treeExplorerViewlet.ts
+6
-11
src/vs/workbench/services/activity/common/activityService.ts
src/vs/workbench/services/activity/common/activityService.ts
+0
-1
未找到文件。
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
浏览文件 @
6793e088
...
...
@@ -30,15 +30,6 @@ export class ActivitybarPart extends Part implements IActivityService {
private
activityActionItems
:
{
[
actionId
:
string
]:
IActionItem
;
};
private
compositeIdToActions
:
{
[
compositeId
:
string
]:
ActivityAction
;
};
// Serves two purposes:
// 1. Expose the viewletId that will be assigned to an extension viewlet,
// which wouldn't know its viewletId until construction time.
// 2. When workbench restores sidebar, if the last-opened viewlet is an extension viewlet,
// it'll set this value and defer restoration until all extensions are loaded.
private
_extViewletIdToOpen
:
string
;
public
get
extViewletIdToOpen
()
{
return
this
.
_extViewletIdToOpen
;
};
public
set
extViewletIdToOpen
(
viewletId
:
string
)
{
this
.
_extViewletIdToOpen
=
viewletId
;
};
constructor
(
id
:
string
,
@
IViewletService
private
viewletService
:
IViewletService
,
...
...
@@ -62,7 +53,7 @@ export class ActivitybarPart extends Part implements IActivityService {
// Deactivate viewlet action on close
this
.
toUnbind
.
push
(
this
.
viewletService
.
onDidViewletClose
(
viewlet
=>
this
.
onCompositeClosed
(
viewlet
)));
this
.
toUnbind
.
push
(
this
.
viewletService
.
onDidViewletRegister
(()
=>
this
.
onDidViewletRegist
er
()));
this
.
toUnbind
.
push
(
this
.
viewletService
.
onDidViewletRegister
(()
=>
this
.
refreshViewletSwitch
er
()));
}
private
onActiveCompositeChanged
(
composite
:
IComposite
):
void
{
...
...
@@ -77,10 +68,6 @@ export class ActivitybarPart extends Part implements IActivityService {
}
}
private
onDidViewletRegister
():
void
{
this
.
refreshViewletSwitcher
();
}
public
showActivity
(
compositeId
:
string
,
badge
:
IBadge
,
clazz
?:
string
):
void
{
const
action
=
this
.
compositeIdToActions
[
compositeId
];
if
(
action
)
{
...
...
@@ -127,12 +114,6 @@ export class ActivitybarPart extends Part implements IActivityService {
private
toAction
(
composite
:
ViewletDescriptor
):
ActivityAction
{
const
action
=
this
.
instantiationService
.
createInstance
(
ViewletActivityAction
,
composite
.
id
+
'
.activity-bar-action
'
,
composite
);
// Store the viewletId of the extension viewlet that is about to open.
// Later retrieved by TreeExplorerViewlet, which wouldn't know its id until
// its construction at runtime.
action
.
onOpenExtViewlet
((
viewletId
)
=>
{
this
.
_extViewletIdToOpen
=
viewletId
;
});
this
.
activityActionItems
[
action
.
id
]
=
new
ActivityActionItem
(
action
,
composite
.
name
,
this
.
getKeybindingLabel
(
composite
.
id
));
this
.
compositeIdToActions
[
composite
.
id
]
=
action
;
...
...
src/vs/workbench/browser/viewlet.ts
浏览文件 @
6793e088
...
...
@@ -155,6 +155,10 @@ export class ViewletDescriptor extends CompositeDescriptor<Viewlet> {
constructor
(
moduleId
:
string
,
ctorName
:
string
,
id
:
string
,
name
:
string
,
cssClass
?:
string
,
order
?:
number
,
public
isExtension
:
boolean
=
false
)
{
super
(
moduleId
,
ctorName
,
id
,
name
,
cssClass
,
order
);
if
(
isExtension
)
{
// Pass viewletId to extension viewlet, which doesn't know its id until runtime.
this
.
appendStaticArguments
([
id
]);
}
}
}
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
6793e088
...
...
@@ -232,15 +232,10 @@ export class Workbench implements IPartService {
viewletId
=
this
.
storageService
.
get
(
SidebarPart
.
activeViewletSettingsKey
,
StorageScope
.
WORKSPACE
,
viewletId
);
// help developers and restore last view
}
// If extension viewlet is the last active viewlet, defer its construction until all extensions are loaded
if
(
!
viewletRegistry
.
getViewlet
(
viewletId
))
{
this
.
activitybarPart
.
extViewletIdToOpen
=
viewletId
;
}
else
{
if
(
!
this
.
sideBarHidden
&&
!!
viewletId
)
{
const
viewletTimerEvent
=
timer
.
start
(
timer
.
Topic
.
STARTUP
,
strings
.
format
(
'
Opening Viewlet: {0}
'
,
viewletId
));
compositeAndEditorPromises
.
push
(
this
.
sidebarPart
.
openViewlet
(
viewletId
,
false
).
then
(()
=>
viewletTimerEvent
.
stop
()));
}
}
// Load Panel
const
panelRegistry
=
Registry
.
as
<
PanelRegistry
>
(
PanelExtensions
.
Panels
);
...
...
src/vs/workbench/parts/explorers/browser/treeExplorerViewlet.ts
浏览文件 @
6793e088
...
...
@@ -14,36 +14,31 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import
{
TreeExplorerView
}
from
'
vs/workbench/parts/explorers/browser/views/treeExplorerView
'
;
import
{
TreeExplorerViewletState
}
from
'
vs/workbench/parts/explorers/browser/views/treeExplorerViewer
'
;
import
{
IActivityService
}
from
'
vs/workbench/services/activity/common/activityService
'
;
import
{
toCustomViewletId
}
from
'
vs/workbench/parts/explorers/common/treeExplorer
'
;
export
class
TreeExplorerViewlet
extends
Viewlet
{
private
static
_idCounter
=
1
;
private
viewletContainer
:
Builder
;
private
view
:
IViewletView
;
private
viewletState
:
TreeExplorerViewletState
;
private
extViewletId
:
string
;
private
viewletId
:
string
;
private
treeNodeProviderId
:
string
;
constructor
(
viewletId
:
string
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IActivityService
private
activityService
:
IActivityService
)
{
super
(
toCustomViewletId
(
TreeExplorerViewlet
.
_idCounter
.
toString
())
,
telemetryService
);
super
(
viewletId
,
telemetryService
);
this
.
viewletState
=
new
TreeExplorerViewletState
();
this
.
extViewletId
=
this
.
activityService
.
extViewletIdToOpen
;
this
.
treeNodeProviderId
=
this
.
getTreeProviderName
(
this
.
extViewletId
);
TreeExplorerViewlet
.
_idCounter
++
;
this
.
viewletId
=
viewletId
;
this
.
treeNodeProviderId
=
this
.
getTreeProviderName
(
viewletId
);
}
public
getId
():
string
{
return
this
.
extV
iewletId
;
return
this
.
v
iewletId
;
}
public
create
(
parent
:
Builder
):
TPromise
<
void
>
{
...
...
src/vs/workbench/services/activity/common/activityService.ts
浏览文件 @
6793e088
...
...
@@ -60,7 +60,6 @@ export const IActivityService = createDecorator<IActivityService>('activityServi
export
interface
IActivityService
{
_serviceBrand
:
any
;
extViewletIdToOpen
:
string
;
/**
* Show activity in the activitybar for the given viewlet or panel.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录