Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
712147af
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,发现更多精彩内容 >>
提交
712147af
编写于
11月 04, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debugActionsWidget: use action weights
上级
dd2e58b4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
45 deletion
+44
-45
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+11
-10
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
+33
-35
未找到文件。
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
712147af
...
...
@@ -34,7 +34,8 @@ export class AbstractDebugAction extends Action {
constructor
(
id
:
string
,
label
:
string
,
cssClass
:
string
,
@
IDebugService
protected
debugService
:
IDebugService
,
@
IKeybindingService
protected
keybindingService
:
IKeybindingService
@
IKeybindingService
protected
keybindingService
:
IKeybindingService
,
public
weight
?:
number
)
{
super
(
id
,
label
,
cssClass
,
false
);
this
.
debugService
=
debugService
;
...
...
@@ -134,7 +135,7 @@ export class RestartAction extends AbstractDebugAction {
static
RECONNECT_LABEL
=
nls
.
localize
(
'
reconnectDebug
'
,
"
Reconnect
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action restart
'
,
debugService
,
keybindingService
);
super
(
id
,
label
,
'
debug-action restart
'
,
debugService
,
keybindingService
,
70
);
this
.
setLabel
(
this
.
debugService
.
getViewModel
().
focusedProcess
);
this
.
toDispose
.
push
(
this
.
debugService
.
getViewModel
().
onDidFocusStackFrame
(()
=>
this
.
setLabel
(
this
.
debugService
.
getViewModel
().
focusedProcess
)));
}
...
...
@@ -158,7 +159,7 @@ export class StepOverAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
stepOverDebug
'
,
"
Step Over
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action step-over
'
,
debugService
,
keybindingService
);
super
(
id
,
label
,
'
debug-action step-over
'
,
debugService
,
keybindingService
,
20
);
}
public
run
(
thread
:
debug
.
IThread
):
TPromise
<
any
>
{
...
...
@@ -179,7 +180,7 @@ export class StepIntoAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
stepIntoDebug
'
,
"
Step Into
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action step-into
'
,
debugService
,
keybindingService
);
super
(
id
,
label
,
'
debug-action step-into
'
,
debugService
,
keybindingService
,
30
);
}
public
run
(
thread
:
debug
.
IThread
):
TPromise
<
any
>
{
...
...
@@ -200,7 +201,7 @@ export class StepOutAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
stepOutDebug
'
,
"
Step Out
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action step-out
'
,
debugService
,
keybindingService
);
super
(
id
,
label
,
'
debug-action step-out
'
,
debugService
,
keybindingService
,
40
);
}
public
run
(
thread
:
debug
.
IThread
):
TPromise
<
any
>
{
...
...
@@ -221,7 +222,7 @@ export class StepBackAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
stepBackDebug
'
,
"
Step Back
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action step-back
'
,
debugService
,
keybindingService
);
super
(
id
,
label
,
'
debug-action step-back
'
,
debugService
,
keybindingService
,
50
);
}
public
run
(
thread
:
debug
.
IThread
):
TPromise
<
any
>
{
...
...
@@ -244,7 +245,7 @@ export class StopAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
stopDebug
'
,
"
Stop
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action stop
'
,
debugService
,
keybindingService
);
super
(
id
,
label
,
'
debug-action stop
'
,
debugService
,
keybindingService
,
80
);
}
public
run
():
TPromise
<
any
>
{
...
...
@@ -262,7 +263,7 @@ export class DisconnectAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
disconnectDebug
'
,
"
Disconnect
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action disconnect
'
,
debugService
,
keybindingService
);
super
(
id
,
label
,
'
debug-action disconnect
'
,
debugService
,
keybindingService
,
80
);
}
public
run
():
TPromise
<
any
>
{
...
...
@@ -280,7 +281,7 @@ export class ContinueAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
continueDebug
'
,
"
Continue
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action continue
'
,
debugService
,
keybindingService
);
super
(
id
,
label
,
'
debug-action continue
'
,
debugService
,
keybindingService
,
10
);
}
public
run
(
thread
:
debug
.
IThread
):
TPromise
<
any
>
{
...
...
@@ -301,7 +302,7 @@ export class PauseAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
pauseDebug
'
,
"
Pause
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action pause
'
,
debugService
,
keybindingService
);
super
(
id
,
label
,
'
debug-action pause
'
,
debugService
,
keybindingService
,
10
);
}
public
run
(
thread
:
debug
.
IThread
):
TPromise
<
any
>
{
...
...
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
浏览文件 @
712147af
...
...
@@ -16,7 +16,7 @@ import { ActionBar, ActionsOrientation } from 'vs/base/browser/ui/actionbar/acti
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
*
as
debug
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
PauseAction
,
ContinueAction
,
StepBackAction
,
StopAction
,
DisconnectAction
,
StepOverAction
,
StepIntoAction
,
StepOutAction
,
RestartAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
AbstractDebugAction
,
PauseAction
,
ContinueAction
,
StepBackAction
,
StopAction
,
DisconnectAction
,
StepOverAction
,
StepIntoAction
,
StepOutAction
,
RestartAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
...
...
@@ -34,12 +34,7 @@ export class DebugActionsWidget implements IWorkbenchContribution {
private
dragArea
:
builder
.
Builder
;
private
toDispose
:
lifecycle
.
IDisposable
[];
private
actionBar
:
ActionBar
;
private
actions
:
IAction
[];
private
pauseAction
:
PauseAction
;
private
continueAction
:
ContinueAction
;
private
stepBackAction
:
StepBackAction
;
private
stopAction
:
StopAction
;
private
disconnectAction
:
DisconnectAction
;
private
actions
:
AbstractDebugAction
[];
private
isVisible
:
boolean
;
private
isBuilt
:
boolean
;
...
...
@@ -139,7 +134,7 @@ export class DebugActionsWidget implements IWorkbenchContribution {
}
this
.
actionBar
.
clear
();
this
.
actionBar
.
push
(
this
.
getActions
(
this
.
instantiationService
,
this
.
debugService
.
state
),
{
icon
:
true
,
label
:
false
});
this
.
actionBar
.
push
(
this
.
getActions
(),
{
icon
:
true
,
label
:
false
});
this
.
show
();
}
...
...
@@ -162,43 +157,46 @@ export class DebugActionsWidget implements IWorkbenchContribution {
this
.
$el
.
hide
();
}
private
getActions
(
instantiationService
:
IInstantiationService
,
state
:
debug
.
State
):
IAction
[]
{
private
getActions
():
IAction
[]
{
if
(
!
this
.
actions
)
{
this
.
continueAction
=
instantiationService
.
createInstance
(
ContinueAction
,
ContinueAction
.
ID
,
ContinueAction
.
LABEL
);
this
.
pauseAction
=
instantiationService
.
createInstance
(
PauseAction
,
PauseAction
.
ID
,
PauseAction
.
LABEL
);
this
.
stopAction
=
instantiationService
.
createInstance
(
StopAction
,
StopAction
.
ID
,
StopAction
.
LABEL
);
this
.
disconnectAction
=
instantiationService
.
createInstance
(
DisconnectAction
,
DisconnectAction
.
ID
,
DisconnectAction
.
LABEL
);
this
.
actions
=
[
this
.
continueAction
,
instantiationService
.
createInstance
(
StepOverAction
,
StepOverAction
.
ID
,
StepOverAction
.
LABEL
),
instantiationService
.
createInstance
(
StepIntoAction
,
StepIntoAction
.
ID
,
StepIntoAction
.
LABEL
),
instantiationService
.
createInstance
(
StepOutAction
,
StepOutAction
.
ID
,
StepOutAction
.
LABEL
),
instantiationService
.
createInstance
(
RestartAction
,
RestartAction
.
ID
,
RestartAction
.
LABEL
),
this
.
stopAction
];
this
.
actions
=
[];
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
ContinueAction
,
ContinueAction
.
ID
,
ContinueAction
.
LABEL
));
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
PauseAction
,
PauseAction
.
ID
,
PauseAction
.
LABEL
));
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
StopAction
,
StopAction
.
ID
,
StopAction
.
LABEL
));
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
DisconnectAction
,
DisconnectAction
.
ID
,
DisconnectAction
.
LABEL
));
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
StepOverAction
,
StepOverAction
.
ID
,
StepOverAction
.
LABEL
));
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
StepIntoAction
,
StepIntoAction
.
ID
,
StepIntoAction
.
LABEL
));
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
StepOutAction
,
StepOutAction
.
ID
,
StepOutAction
.
LABEL
));
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RestartAction
,
RestartAction
.
ID
,
RestartAction
.
LABEL
));
this
.
actions
.
push
(
this
.
instantiationService
.
createInstance
(
StepBackAction
,
StepBackAction
.
ID
,
StepBackAction
.
LABEL
));
this
.
actions
.
forEach
(
a
=>
{
this
.
toDispose
.
push
(
a
);
});
this
.
toDispose
.
push
(
this
.
pauseAction
);
this
.
toDispose
.
push
(
this
.
disconnectAction
);
}
this
.
actions
[
0
]
=
state
===
debug
.
State
.
Running
?
this
.
pauseAction
:
this
.
continueAction
;
const
state
=
this
.
debugService
.
state
;
const
process
=
this
.
debugService
.
getViewModel
().
focusedProcess
;
this
.
actions
[
5
]
=
(
process
&&
!
strings
.
equalsIgnoreCase
(
process
.
session
.
configuration
.
type
,
'
extensionHost
'
)
&&
process
.
session
.
requestType
===
debug
.
SessionRequestType
.
ATTACH
)
?
this
.
disconnectAction
:
this
.
stopAction
;
const
attached
=
process
&&
!
strings
.
equalsIgnoreCase
(
process
.
session
.
configuration
.
type
,
'
extensionHost
'
)
&&
process
.
session
.
requestType
===
debug
.
SessionRequestType
.
ATTACH
;
if
(
process
&&
process
.
session
.
configuration
.
capabilities
.
supportsStepBack
)
{
if
(
!
this
.
stepBackAction
)
{
this
.
stepBackAction
=
instantiationService
.
createInstance
(
StepBackAction
,
StepBackAction
.
ID
,
StepBackAction
.
LABEL
);
this
.
toDispose
.
push
(
this
.
stepBackAction
);
return
this
.
actions
.
filter
(
a
=>
{
if
(
a
.
id
===
ContinueAction
.
ID
)
{
return
state
!==
debug
.
State
.
Running
;
}
if
(
a
.
id
===
PauseAction
.
ID
)
{
return
state
===
debug
.
State
.
Running
;
}
if
(
a
.
id
===
StepBackAction
.
ID
)
{
return
process
&&
process
.
session
.
configuration
.
capabilities
.
supportsStepBack
;
}
if
(
a
.
id
===
DisconnectAction
.
ID
)
{
return
attached
;
}
if
(
a
.
id
===
StopAction
.
ID
)
{
return
!
attached
;
}
// Return a copy of this.actions containing stepBackAction
return
[...
this
.
actions
.
slice
(
0
,
4
),
this
.
stepBackAction
,
...
this
.
actions
.
slice
(
4
)];
}
else
{
return
this
.
actions
;
}
return
true
;
}).
sort
((
first
,
second
)
=>
first
.
weight
-
second
.
weight
);
}
public
dispose
():
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录