Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
42d7d3a4
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,体验更适合开发者的 AI 搜索 >>
提交
42d7d3a4
编写于
1月 13, 2021
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
breakpoints view: render edit action inline for exception breakpoints
上级
40d6f798
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
11 deletion
+33
-11
src/vs/workbench/contrib/debug/browser/breakpointsView.ts
src/vs/workbench/contrib/debug/browser/breakpointsView.ts
+29
-7
src/vs/workbench/contrib/debug/browser/media/debugViewlet.css
...vs/workbench/contrib/debug/browser/media/debugViewlet.css
+4
-4
未找到文件。
src/vs/workbench/contrib/debug/browser/breakpointsView.ts
浏览文件 @
42d7d3a4
...
...
@@ -38,8 +38,10 @@ import * as icons from 'vs/workbench/contrib/debug/browser/debugIcons';
import
{
registerAction2
,
Action2
,
MenuId
,
IMenu
,
IMenuService
}
from
'
vs/platform/actions/common/actions
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
ServicesAccessor
}
from
'
vs/editor/browser/editorExtensions
'
;
import
{
createAndFillInContextMenuActions
}
from
'
vs/platform/actions/browser/menuEntryActionViewItem
'
;
import
{
createAndFillInContextMenuActions
,
createAndFillInActionBarActions
}
from
'
vs/platform/actions/browser/menuEntryActionViewItem
'
;
import
{
isCodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Codicon
}
from
'
vs/base/common/codicons
'
;
const
$
=
dom
.
$
;
...
...
@@ -109,7 +111,7 @@ export class BreakpointsView extends ViewPane {
this
.
list
=
<
WorkbenchList
<
BreakpointItem
>>
this
.
instantiationService
.
createInstance
(
WorkbenchList
,
'
Breakpoints
'
,
container
,
delegate
,
[
this
.
instantiationService
.
createInstance
(
BreakpointsRenderer
),
new
ExceptionBreakpointsRenderer
(
this
.
debugService
),
new
ExceptionBreakpointsRenderer
(
this
.
menu
,
this
.
debugService
),
new
ExceptionBreakpointInputRenderer
(
this
.
debugService
,
this
.
contextViewService
,
this
.
themeService
),
this
.
instantiationService
.
createInstance
(
FunctionBreakpointsRenderer
),
this
.
instantiationService
.
createInstance
(
DataBreakpointsRenderer
),
...
...
@@ -202,12 +204,12 @@ export class BreakpointsView extends ViewPane {
this
.
breakpointItemType
.
set
(
type
);
this
.
exceptionBreakpointSupportsCondition
.
set
(
element
instanceof
ExceptionBreakpoint
&&
element
.
supportsCondition
);
const
actions
:
IAction
[]
=
[];
const
actionsDisposable
=
createAndFillInContextMenuActions
(
this
.
menu
,
{
arg
:
e
.
element
,
shouldForwardArgs
:
false
},
actions
);
const
secondary
:
IAction
[]
=
[];
const
actionsDisposable
=
createAndFillInContextMenuActions
(
this
.
menu
,
{
arg
:
e
.
element
,
shouldForwardArgs
:
false
},
{
primary
:
[],
secondary
},
g
=>
/^inline/
.
test
(
g
)
);
this
.
contextMenuService
.
showContextMenu
({
getAnchor
:
()
=>
e
.
anchor
,
getActions
:
()
=>
actions
,
getActions
:
()
=>
secondary
,
getActionsContext
:
()
=>
element
,
onHide
:
()
=>
dispose
(
actionsDisposable
)
});
...
...
@@ -289,7 +291,9 @@ interface IBaseBreakpointTemplateData {
name
:
HTMLElement
;
checkbox
:
HTMLInputElement
;
context
:
BreakpointItem
;
actionBar
:
ActionBar
;
toDispose
:
IDisposable
[];
elementDisposable
:
IDisposable
[];
}
interface
IBaseBreakpointWithIconTemplateData
extends
IBaseBreakpointTemplateData
{
...
...
@@ -390,6 +394,7 @@ class BreakpointsRenderer implements IListRenderer<IBreakpoint, IBreakpointTempl
class
ExceptionBreakpointsRenderer
implements
IListRenderer
<
IExceptionBreakpoint
,
IExceptionBreakpointTemplateData
>
{
constructor
(
private
menu
:
IMenu
,
private
debugService
:
IDebugService
)
{
// noop
...
...
@@ -407,6 +412,7 @@ class ExceptionBreakpointsRenderer implements IListRenderer<IExceptionBreakpoint
data
.
checkbox
=
createCheckbox
();
data
.
toDispose
=
[];
data
.
elementDisposable
=
[];
data
.
toDispose
.
push
(
dom
.
addStandardDisposableListener
(
data
.
checkbox
,
'
change
'
,
(
e
)
=>
{
this
.
debugService
.
enableOrDisableBreakpoints
(
!
data
.
context
.
enabled
,
data
.
context
);
}));
...
...
@@ -417,6 +423,8 @@ class ExceptionBreakpointsRenderer implements IListRenderer<IExceptionBreakpoint
data
.
condition
=
dom
.
append
(
data
.
breakpoint
,
$
(
'
span.condition
'
));
data
.
breakpoint
.
classList
.
add
(
'
exception
'
);
data
.
actionBar
=
new
ActionBar
(
data
.
breakpoint
);
data
.
toDispose
.
push
(
data
.
actionBar
);
return
data
;
}
...
...
@@ -427,6 +435,15 @@ class ExceptionBreakpointsRenderer implements IListRenderer<IExceptionBreakpoint
data
.
checkbox
.
checked
=
exceptionBreakpoint
.
enabled
;
data
.
condition
.
textContent
=
exceptionBreakpoint
.
condition
||
''
;
data
.
condition
.
title
=
localize
(
'
expressionCondition
'
,
"
Expression condition: {0}
"
,
exceptionBreakpoint
.
condition
);
const
primary
:
IAction
[]
=
[];
data
.
elementDisposable
.
push
(
createAndFillInActionBarActions
(
this
.
menu
,
{
arg
:
exceptionBreakpoint
,
shouldForwardArgs
:
true
},
{
primary
,
secondary
:
[]
},
g
=>
/^inline/
.
test
(
g
)));
data
.
actionBar
.
clear
();
data
.
actionBar
.
push
(
primary
,
{
icon
:
true
,
label
:
false
});
}
disposeElement
(
_element
:
IExceptionBreakpoint
,
_index
:
number
,
templateData
:
IExceptionBreakpointTemplateData
):
void
{
dispose
(
templateData
.
elementDisposable
);
}
disposeTemplate
(
templateData
:
IExceptionBreakpointTemplateData
):
void
{
...
...
@@ -1067,12 +1084,17 @@ registerAction2(class extends Action2 {
constructor
()
{
super
({
id
:
'
workbench.action.debug.editExceptionBreakpointCondition
'
,
title
:
localize
(
'
editCondition
'
,
"
Edit Condition
"
),
title
:
localize
(
'
editCondition
'
,
"
Edit Condition...
"
),
icon
:
Codicon
.
edit
,
menu
:
[{
id
:
MenuId
.
DebugBreakpointsContext
,
group
:
'
navigation
'
,
order
:
10
,
when
:
CONTEXT_EXCEPTION_BREAKPOINT_SUPPORTS_CONDITION
when
:
ContextKeyExpr
.
and
(
CONTEXT_EXCEPTION_BREAKPOINT_SUPPORTS_CONDITION
,
CONTEXT_BREAKPOINT_ITEM_TYPE
.
isEqualTo
(
'
exceptionBreakpoint
'
))
},
{
id
:
MenuId
.
DebugBreakpointsContext
,
group
:
'
inline
'
,
order
:
10
,
}]
});
}
...
...
src/vs/workbench/contrib/debug/browser/media/debugViewlet.css
浏览文件 @
42d7d3a4
...
...
@@ -144,22 +144,22 @@
display
:
none
;
}
.debug-pane
.
debug-call-stack
.
monaco-list-row
.monaco-action-bar
{
.debug-pane
.monaco-list-row
.monaco-action-bar
{
display
:
none
;
flex-shrink
:
0
;
margin-right
:
1px
;
}
.debug-pane
.
debug-call-stack
.
monaco-list-row
:hover
.monaco-action-bar
{
.debug-pane
.monaco-list-row
:hover
.monaco-action-bar
{
display
:
initial
;
}
.debug-pane
.
debug-call-stack
.
session
.codicon
{
.debug-pane
.session
.codicon
{
line-height
:
22px
;
margin-right
:
2px
;
}
.monaco-workbench
.debug-pane
.debug-call-stack
.monaco-action-bar
.action-item
>
.action-label
{
.monaco-workbench
.debug-pane
.monaco-action-bar
.action-item
>
.action-label
{
width
:
16px
;
height
:
100%
;
line-height
:
22px
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录