Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a2fa13b3
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,发现更多精彩内容 >>
提交
a2fa13b3
编写于
4月 12, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: improve registration of debug views
上级
f033f511
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
26 deletion
+21
-26
src/vs/workbench/parts/debug/browser/debugViewlet.ts
src/vs/workbench/parts/debug/browser/debugViewlet.ts
+5
-5
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+12
-17
src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts
...kbench/parts/debug/electron-browser/debug.contribution.ts
+4
-4
未找到文件。
src/vs/workbench/parts/debug/browser/debugViewlet.ts
浏览文件 @
a2fa13b3
...
...
@@ -34,7 +34,6 @@ export class DebugViewlet extends viewlet.Viewlet {
private
$el
:
builder
.
Builder
;
private
splitView
:
splitview
.
SplitView
;
// TODO@Isidor views need to be splitView.collapsibleView to make them more general
private
views
:
(
viewlet
.
CollapsibleViewletView
|
viewlet
.
AdaptiveCollapsibleViewletView
)[];
private
lastFocusedView
:
viewlet
.
CollapsibleViewletView
|
viewlet
.
AdaptiveCollapsibleViewletView
;
...
...
@@ -65,10 +64,11 @@ export class DebugViewlet extends viewlet.Viewlet {
if
(
this
.
contextService
.
getWorkspace
())
{
const
actionRunner
=
this
.
getActionRunner
();
const
viewDescriptors
=
debug
.
DebugViewRegistry
.
getDebugViews
().
sort
((
first
,
second
)
=>
first
.
order
-
second
.
order
);
// TODO@Isi viewDescriptors mixed descriptors with different arguments (# of arguments) which means
// you fail to use the createInstance method which checks for the ctor-args of the type you create.
this
.
views
=
viewDescriptors
.
map
(
dsc
=>
<
any
>
this
.
instantiationService
.
createInstance
(
<
any
>
dsc
,
actionRunner
,
this
.
viewletSettings
));
this
.
views
=
debug
.
DebugViewRegistry
.
getDebugViews
().
map
(
viewConstructor
=>
this
.
instantiationService
.
createInstance
(
viewConstructor
,
actionRunner
,
this
.
viewletSettings
)
);
this
.
splitView
=
new
splitview
.
SplitView
(
this
.
$el
.
getHTMLElement
());
this
.
toDispose
.
push
(
this
.
splitView
);
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
a2fa13b3
...
...
@@ -5,11 +5,11 @@
import
uri
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IActionRunner
}
from
'
vs/base/common/actions
'
;
import
ee
=
require
(
'
vs/base/common/eventEmitter
'
);
import
severity
from
'
vs/base/common/severity
'
;
import
{
AdaptiveCollapsibleViewletView
,
CollapsibleViewletView
}
from
'
vs/workbench/browser/viewlet
'
;
import
{
createDecorator
,
ServiceIdentifier
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
editor
=
require
(
'
vs/editor/common/editorCommon
'
);
import
editorbrowser
=
require
(
'
vs/editor/browser/editorBrowser
'
);
import
{
Source
}
from
'
vs/workbench/parts/debug/common/debugSource
'
;
...
...
@@ -348,36 +348,31 @@ export interface IDebugEditorContribution extends editor.IEditorContribution {
showHover
(
range
:
editor
.
IEditorRange
,
hoveringOver
:
string
,
focus
:
boolean
):
TPromise
<
void
>
;
}
// Debug view
descriptors and
registration
// Debug view registration
export
class
DebugViewDescriptor
extends
SyncDescriptor
<
CollapsibleViewletView
|
AdaptiveCollapsibleViewletView
>
{
constructor
(
ctor
:
any
,
public
order
:
number
)
{
super
(
ctor
);
}
export
interface
IDebugViewConstructorSignature
{
new
(
actionRunner
:
IActionRunner
,
viewletSetings
:
any
,
...
services
:
{
serviceId
:
ServiceIdentifier
<
any
>
;
}[]):
AdaptiveCollapsibleViewletView
|
CollapsibleViewletView
;
}
export
interface
IDebugViewRegistry
{
registerDebugView
(
descriptor
:
DebugViewDescripto
r
):
void
;
getDebugViews
():
DebugViewDescriptor
[];
registerDebugView
(
view
:
IDebugViewConstructorSignature
,
order
:
numbe
r
):
void
;
getDebugViews
():
IDebugViewConstructorSignature
[];
}
class
DebugViewRegistryImpl
implements
IDebugViewRegistry
{
private
debugViews
:
DebugViewDescriptor
[];
private
debugViews
:
{
view
:
IDebugViewConstructorSignature
,
order
:
number
}
[];
constructor
()
{
this
.
debugViews
=
[];
}
public
registerDebugView
(
descriptor
:
DebugViewDescriptor
):
void
{
if
(
this
.
debugViews
.
some
(
dsc
=>
dsc
.
equals
(
descriptor
)))
{
return
;
}
this
.
debugViews
.
push
(
descriptor
);
public
registerDebugView
(
view
:
IDebugViewConstructorSignature
,
order
:
number
):
void
{
this
.
debugViews
.
push
({
view
,
order
});
}
public
getDebugViews
():
DebugViewDescriptor
[]
{
return
this
.
debugViews
;
public
getDebugViews
():
IDebugViewConstructorSignature
[]
{
return
this
.
debugViews
.
sort
((
first
,
second
)
=>
first
.
order
-
second
.
order
)
.
map
(
viewWithOrder
=>
viewWithOrder
.
view
);
}
}
...
...
src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts
浏览文件 @
a2fa13b3
...
...
@@ -85,10 +85,10 @@ const openViewletKb: IKeybindings = {
(
<
panel
.
PanelRegistry
>
platform
.
Registry
.
as
(
panel
.
Extensions
.
Panels
)).
setDefaultPanelId
(
debug
.
REPL_ID
);
// Register default debug views
debug
.
DebugViewRegistry
.
registerDebugView
(
new
debug
.
DebugViewDescriptor
(
VariablesView
,
10
)
);
debug
.
DebugViewRegistry
.
registerDebugView
(
new
debug
.
DebugViewDescriptor
(
WatchExpressionsView
,
20
)
);
debug
.
DebugViewRegistry
.
registerDebugView
(
new
debug
.
DebugViewDescriptor
(
CallStackView
,
30
)
);
debug
.
DebugViewRegistry
.
registerDebugView
(
new
debug
.
DebugViewDescriptor
(
BreakpointsView
,
40
)
);
debug
.
DebugViewRegistry
.
registerDebugView
(
VariablesView
,
10
);
debug
.
DebugViewRegistry
.
registerDebugView
(
WatchExpressionsView
,
20
);
debug
.
DebugViewRegistry
.
registerDebugView
(
CallStackView
,
30
);
debug
.
DebugViewRegistry
.
registerDebugView
(
BreakpointsView
,
40
);
// register action to open viewlet
const
registry
=
(
<
wbaregistry
.
IWorkbenchActionRegistry
>
platform
.
Registry
.
as
(
wbaregistry
.
Extensions
.
WorkbenchActions
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录