Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5cd5974f
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,发现更多精彩内容 >>
提交
5cd5974f
编写于
12月 09, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Breakpoints context menu
fixes #16645
上级
a4f6a141
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
34 deletion
+35
-34
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+18
-5
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
...h/parts/debug/electron-browser/debugEditorContribution.ts
+6
-2
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
+10
-26
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
+1
-1
未找到文件。
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
5cd5974f
...
...
@@ -330,16 +330,29 @@ export class RemoveAllBreakpointsAction extends AbstractDebugAction {
}
}
export
class
ToggleEnableme
ntAction
extends
AbstractDebugAction
{
static
ID
=
'
workbench.debug.viewlet.action.
toggleBreakpointEnableme
nt
'
;
static
LABEL
=
nls
.
localize
(
'
toggleEnablement
'
,
"
Enable/Dis
able Breakpoint
"
);
export
class
EnableBreakpoi
ntAction
extends
AbstractDebugAction
{
static
ID
=
'
workbench.debug.viewlet.action.
enableBreakpoi
nt
'
;
static
LABEL
=
nls
.
localize
(
'
enableBreakpoint
'
,
"
En
able Breakpoint
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action toggle-enablement
'
,
debugService
,
keybindingService
);
super
(
id
,
label
,
undefined
,
debugService
,
keybindingService
);
}
public
run
(
element
:
IEnablement
):
TPromise
<
any
>
{
return
this
.
debugService
.
enableOrDisableBreakpoints
(
!
element
.
enabled
,
element
);
return
this
.
debugService
.
enableOrDisableBreakpoints
(
true
,
element
);
}
}
export
class
DisableBreakpointAction
extends
AbstractDebugAction
{
static
ID
=
'
workbench.debug.viewlet.action.disableBreakpoint
'
;
static
LABEL
=
nls
.
localize
(
'
disableBreakpoint
'
,
"
Disable Breakpoint
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
undefined
,
debugService
,
keybindingService
);
}
public
run
(
element
:
IEnablement
):
TPromise
<
any
>
{
return
this
.
debugService
.
enableOrDisableBreakpoints
(
false
,
element
);
}
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
浏览文件 @
5cd5974f
...
...
@@ -25,7 +25,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands';
import
{
IContextKeyService
,
IContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
DebugHoverWidget
}
from
'
vs/workbench/parts/debug/electron-browser/debugHover
'
;
import
{
RemoveBreakpointAction
,
EditConditionalBreakpointAction
,
ToggleEnableme
ntAction
,
AddConditionalBreakpointAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
RemoveBreakpointAction
,
EditConditionalBreakpointAction
,
EnableBreakpointAction
,
DisableBreakpoi
ntAction
,
AddConditionalBreakpointAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
IDebugEditorContribution
,
IDebugService
,
State
,
IBreakpoint
,
EDITOR_CONTRIBUTION_ID
,
CONTEXT_BREAKPOINT_WIDGET_VISIBLE
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
BreakpointWidget
}
from
'
vs/workbench/parts/debug/browser/breakpointWidget
'
;
import
{
FloatingClickWidget
}
from
'
vs/workbench/parts/preferences/browser/preferencesWidgets
'
;
...
...
@@ -73,7 +73,11 @@ export class DebugEditorContribution implements IDebugEditorContribution {
if
(
breakpoint
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RemoveBreakpointAction
,
RemoveBreakpointAction
.
ID
,
RemoveBreakpointAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
EditConditionalBreakpointAction
,
EditConditionalBreakpointAction
.
ID
,
EditConditionalBreakpointAction
.
LABEL
,
this
.
editor
,
lineNumber
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
ToggleEnablementAction
,
ToggleEnablementAction
.
ID
,
ToggleEnablementAction
.
LABEL
));
if
(
breakpoint
.
enabled
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
DisableBreakpointAction
,
DisableBreakpointAction
.
ID
,
DisableBreakpointAction
.
LABEL
));
}
else
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
EnableBreakpointAction
,
EnableBreakpointAction
.
ID
,
EnableBreakpointAction
.
LABEL
));
}
}
else
{
actions
.
push
(
new
Action
(
'
addBreakpoint
'
,
...
...
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
浏览文件 @
5cd5974f
...
...
@@ -31,7 +31,7 @@ import { fillInActions } from 'vs/platform/actions/browser/menuItemActionItem';
import
*
as
debug
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
Expression
,
Variable
,
FunctionBreakpoint
,
StackFrame
,
Thread
,
Process
,
Breakpoint
,
ExceptionBreakpoint
,
Model
,
Scope
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
import
{
ViewModel
}
from
'
vs/workbench/parts/debug/common/debugViewModel
'
;
import
{
ContinueAction
,
StepOverAction
,
PauseAction
,
AddFunctionBreakpointAction
,
ReapplyBreakpointsAction
,
DisableAllBreakpointsAction
,
RemoveBreakpointAction
,
ToggleEnablementAction
,
RenameFunctionBreakpointAction
,
RemoveWatchExpressionAction
,
AddWatchExpressionAction
,
EditWatchExpressionAction
,
RemoveAllBreakpointsAction
,
EnableAllBreakpointsAction
,
StepOutAction
,
StepIntoAction
,
SetValueAction
,
RemoveAllWatchExpressionsAction
,
ToggleBreakpointsActivated
Action
,
RestartFrameAction
,
AddToWatchExpressionsAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
ContinueAction
,
StepOverAction
,
PauseAction
,
ReapplyBreakpointsAction
,
DisableAllBreakpointsAction
,
RemoveBreakpointAction
,
RemoveWatchExpressionAction
,
AddWatchExpressionAction
,
EditWatchExpressionAction
,
RemoveAllBreakpointsAction
,
EnableAllBreakpointsAction
,
StepOutAction
,
StepIntoAction
,
SetValueAction
,
RemoveAllWatchExpressions
Action
,
RestartFrameAction
,
AddToWatchExpressionsAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
CopyValueAction
}
from
'
vs/workbench/parts/debug/electron-browser/electronDebugActions
'
;
import
{
Source
}
from
'
vs/workbench/parts/debug/common/debugSource
'
;
...
...
@@ -1099,12 +1099,12 @@ export class WatchExpressionsDragAndDrop extends DefaultDragAndDrop {
export
class
BreakpointsActionProvider
implements
IActionProvider
{
constructor
(
private
instantiationService
:
IInstantiationService
)
{
constructor
(
private
instantiationService
:
IInstantiationService
,
private
debugService
:
debug
.
IDebugService
)
{
// noop
}
public
hasActions
(
tree
:
ITree
,
element
:
any
):
boolean
{
return
element
instanceof
Breakpoint
;
return
false
;
;
}
public
hasSecondaryActions
(
tree
:
ITree
,
element
:
any
):
boolean
{
...
...
@@ -1112,40 +1112,24 @@ export class BreakpointsActionProvider implements IActionProvider {
}
public
getActions
(
tree
:
ITree
,
element
:
any
):
TPromise
<
IAction
[]
>
{
if
(
element
instanceof
Breakpoint
)
{
return
TPromise
.
as
(
this
.
getBreakpointActions
());
}
return
TPromise
.
as
([]);
}
public
getBreakpointActions
():
IAction
[]
{
return
[
this
.
instantiationService
.
createInstance
(
RemoveBreakpointAction
,
RemoveBreakpointAction
.
ID
,
RemoveBreakpointAction
.
LABEL
)];
}
public
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
TPromise
<
IAction
[]
>
{
const
actions
:
IAction
[]
=
[
this
.
instantiationService
.
createInstance
(
ToggleEnablementAction
,
ToggleEnablementAction
.
ID
,
ToggleEnablementAction
.
LABEL
)];
actions
.
push
(
new
Separator
());
const
actions
:
IAction
[]
=
[];
if
(
element
instanceof
Breakpoint
||
element
instanceof
FunctionBreakpoint
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RemoveBreakpointAction
,
RemoveBreakpointAction
.
ID
,
RemoveBreakpointAction
.
LABEL
));
}
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RemoveAllBreakpointsAction
,
RemoveAllBreakpointsAction
.
ID
,
RemoveAllBreakpointsAction
.
LABEL
));
actions
.
push
(
new
Separator
());
actions
.
push
(
this
.
instantiationService
.
createInstance
(
ToggleBreakpointsActivatedAction
,
ToggleBreakpointsActivatedAction
.
ID
,
ToggleBreakpointsActivatedAction
.
ACTIVATE_LABEL
));
actions
.
push
(
new
Separator
());
actions
.
push
(
this
.
instantiationService
.
createInstance
(
EnableAllBreakpointsAction
,
EnableAllBreakpointsAction
.
ID
,
EnableAllBreakpointsAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
DisableAllBreakpointsAction
,
DisableAllBreakpointsAction
.
ID
,
DisableAllBreakpointsAction
.
LABEL
));
actions
.
push
(
new
Separator
());
if
(
this
.
debugService
.
getModel
().
getBreakpoints
().
length
+
this
.
debugService
.
getModel
().
getFunctionBreakpoints
().
length
>
1
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RemoveAllBreakpointsAction
,
RemoveAllBreakpointsAction
.
ID
,
RemoveAllBreakpointsAction
.
LABEL
));
actions
.
push
(
new
Separator
());
actions
.
push
(
this
.
instantiationService
.
createInstance
(
AddFunctionBreakpointAction
,
AddFunctionBreakpointAction
.
ID
,
AddFunctionBreakpointAction
.
LABEL
));
if
(
element
instanceof
FunctionBreakpoint
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RenameFunctionBreakpointAction
,
RenameFunctionBreakpointAction
.
ID
,
RenameFunctionBreakpointAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
EnableAllBreakpointsAction
,
EnableAllBreakpointsAction
.
ID
,
EnableAllBreakpointsAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
DisableAllBreakpointsAction
,
DisableAllBreakpointsAction
.
ID
,
DisableAllBreakpointsAction
.
LABEL
));
}
actions
.
push
(
new
Separator
());
actions
.
push
(
new
Separator
());
actions
.
push
(
this
.
instantiationService
.
createInstance
(
ReapplyBreakpointsAction
,
ReapplyBreakpointsAction
.
ID
,
ReapplyBreakpointsAction
.
LABEL
));
return
TPromise
.
as
(
actions
);
...
...
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
浏览文件 @
5cd5974f
...
...
@@ -356,7 +356,7 @@ export class BreakpointsView extends AdaptiveCollapsibleViewletView {
public
renderBody
(
container
:
HTMLElement
):
void
{
dom
.
addClass
(
container
,
'
debug-breakpoints
'
);
this
.
treeContainer
=
renderViewTree
(
container
);
const
actionProvider
=
new
viewer
.
BreakpointsActionProvider
(
this
.
instantiationService
);
const
actionProvider
=
new
viewer
.
BreakpointsActionProvider
(
this
.
instantiationService
,
this
.
debugService
);
this
.
tree
=
new
Tree
(
this
.
treeContainer
,
{
dataSource
:
new
viewer
.
BreakpointsDataSource
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录