Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
745ac177
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,发现更多精彩内容 >>
提交
745ac177
编写于
12月 05, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
edit breakpoint in context menu
fixes #39714
上级
fd1c9a12
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
14 deletion
+30
-14
src/vs/workbench/parts/debug/electron-browser/breakpointsView.ts
...workbench/parts/debug/electron-browser/breakpointsView.ts
+30
-14
未找到文件。
src/vs/workbench/parts/debug/electron-browser/breakpointsView.ts
浏览文件 @
745ac177
...
@@ -7,8 +7,8 @@ import * as nls from 'vs/nls';
...
@@ -7,8 +7,8 @@ import * as nls from 'vs/nls';
import
*
as
resources
from
'
vs/base/common/resources
'
;
import
*
as
resources
from
'
vs/base/common/resources
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IAction
,
Action
}
from
'
vs/base/common/actions
'
;
import
{
IDebugService
,
IBreakpoint
,
CONTEXT_BREAKPOINTS_FOCUSED
,
State
,
DEBUG_SCHEME
,
IFunctionBreakpoint
,
IExceptionBreakpoint
,
IEnablement
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IDebugService
,
IBreakpoint
,
CONTEXT_BREAKPOINTS_FOCUSED
,
EDITOR_CONTRIBUTION_ID
,
State
,
DEBUG_SCHEME
,
IFunctionBreakpoint
,
IExceptionBreakpoint
,
IEnablement
,
IDebugEditorContribution
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
ExceptionBreakpoint
,
FunctionBreakpoint
,
Breakpoint
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
import
{
ExceptionBreakpoint
,
FunctionBreakpoint
,
Breakpoint
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
import
{
AddFunctionBreakpointAction
,
ToggleBreakpointsActivatedAction
,
RemoveAllBreakpointsAction
,
RemoveBreakpointAction
,
EnableAllBreakpointsAction
,
DisableAllBreakpointsAction
,
ReapplyBreakpointsAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
AddFunctionBreakpointAction
,
ToggleBreakpointsActivatedAction
,
RemoveAllBreakpointsAction
,
RemoveBreakpointAction
,
EnableAllBreakpointsAction
,
DisableAllBreakpointsAction
,
ReapplyBreakpointsAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
IContextMenuService
,
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IContextMenuService
,
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
...
@@ -24,7 +24,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
...
@@ -24,7 +24,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IDelegate
,
IListContextMenuEvent
,
IRenderer
}
from
'
vs/base/browser/ui/list/list
'
;
import
{
IDelegate
,
IListContextMenuEvent
,
IRenderer
}
from
'
vs/base/browser/ui/list/list
'
;
import
{
IEditorService
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEditorService
,
IEditor
}
from
'
vs/platform/editor/common/editor
'
;
import
{
InputBox
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
InputBox
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
IKeyboardEvent
,
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
IKeyboardEvent
,
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
...
@@ -32,6 +32,7 @@ import { WorkbenchList, IListService } from 'vs/platform/list/browser/listServic
...
@@ -32,6 +32,7 @@ import { WorkbenchList, IListService } from 'vs/platform/list/browser/listServic
import
{
ViewsViewletPanel
,
IViewletViewOptions
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
import
{
ViewsViewletPanel
,
IViewletViewOptions
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
attachInputBoxStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
attachInputBoxStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
isCodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
const
$
=
dom
.
$
;
const
$
=
dom
.
$
;
...
@@ -80,11 +81,11 @@ export class BreakpointsView extends ViewsViewletPanel {
...
@@ -80,11 +81,11 @@ export class BreakpointsView extends ViewsViewletPanel {
this
.
list
.
onContextMenu
(
this
.
onListContextMenu
,
this
,
this
.
disposables
);
this
.
list
.
onContextMenu
(
this
.
onListContextMenu
,
this
,
this
.
disposables
);
const
handleBreakpointFocus
=
(
preserveFocuse
:
boolean
,
selectFunctionBreakpoint
:
boolean
)
=>
{
const
handleBreakpointFocus
=
(
preserveFocuse
:
boolean
,
s
ideBySide
:
boolean
,
s
electFunctionBreakpoint
:
boolean
)
=>
{
const
focused
=
this
.
list
.
getFocusedElements
();
const
focused
=
this
.
list
.
getFocusedElements
();
const
element
=
focused
.
length
?
focused
[
0
]
:
undefined
;
const
element
=
focused
.
length
?
focused
[
0
]
:
undefined
;
if
(
element
instanceof
Breakpoint
)
{
if
(
element
instanceof
Breakpoint
)
{
openBreakpointSource
(
element
,
event
,
preserveFocuse
,
this
.
debugService
,
this
.
editorService
);
openBreakpointSource
(
element
,
sideBySide
,
preserveFocuse
,
this
.
debugService
,
this
.
editorService
).
done
(
undefined
,
onUnexpectedError
);
}
}
if
(
selectFunctionBreakpoint
&&
element
instanceof
FunctionBreakpoint
)
{
if
(
selectFunctionBreakpoint
&&
element
instanceof
FunctionBreakpoint
)
{
this
.
debugService
.
getViewModel
().
setSelectedFunctionBreakpoint
(
element
);
this
.
debugService
.
getViewModel
().
setSelectedFunctionBreakpoint
(
element
);
...
@@ -94,14 +95,14 @@ export class BreakpointsView extends ViewsViewletPanel {
...
@@ -94,14 +95,14 @@ export class BreakpointsView extends ViewsViewletPanel {
this
.
disposables
.
push
(
this
.
list
.
onKeyUp
(
e
=>
{
this
.
disposables
.
push
(
this
.
list
.
onKeyUp
(
e
=>
{
const
event
=
new
StandardKeyboardEvent
(
e
);
const
event
=
new
StandardKeyboardEvent
(
e
);
if
(
event
.
equals
(
KeyCode
.
Enter
))
{
if
(
event
.
equals
(
KeyCode
.
Enter
))
{
handleBreakpointFocus
(
false
,
false
);
handleBreakpointFocus
(
false
,
event
&&
(
event
.
ctrlKey
||
event
.
metaKey
),
false
);
}
}
}));
}));
this
.
disposables
.
push
(
this
.
list
.
onMouseDblClick
(
e
=>
{
this
.
disposables
.
push
(
this
.
list
.
onMouseDblClick
(
e
=>
{
handleBreakpointFocus
(
false
,
true
);
handleBreakpointFocus
(
false
,
false
,
true
);
}));
}));
this
.
disposables
.
push
(
this
.
list
.
onMouseClick
(
e
=>
{
this
.
disposables
.
push
(
this
.
list
.
onMouseClick
(
e
=>
{
handleBreakpointFocus
(
true
,
false
);
handleBreakpointFocus
(
true
,
false
,
false
);
}));
}));
this
.
list
.
splice
(
0
,
this
.
list
.
length
,
this
.
elements
);
this
.
list
.
splice
(
0
,
this
.
list
.
length
,
this
.
elements
);
...
@@ -115,7 +116,23 @@ export class BreakpointsView extends ViewsViewletPanel {
...
@@ -115,7 +116,23 @@ export class BreakpointsView extends ViewsViewletPanel {
private
onListContextMenu
(
e
:
IListContextMenuEvent
<
IEnablement
>
):
void
{
private
onListContextMenu
(
e
:
IListContextMenuEvent
<
IEnablement
>
):
void
{
const
actions
:
IAction
[]
=
[];
const
actions
:
IAction
[]
=
[];
const
element
=
e
.
element
;
if
(
element
instanceof
Breakpoint
)
{
actions
.
push
(
new
Action
(
'
workbench.action.debug.openEditorAndEditBreakpoint
'
,
nls
.
localize
(
'
editConditionalBreakpoint
'
,
"
Edit Breakpoint...
"
),
undefined
,
true
,
()
=>
{
return
openBreakpointSource
(
element
,
false
,
false
,
this
.
debugService
,
this
.
editorService
).
then
(
editor
=>
{
const
codeEditor
=
editor
.
getControl
();
if
(
isCodeEditor
(
codeEditor
))
{
codeEditor
.
getContribution
<
IDebugEditorContribution
>
(
EDITOR_CONTRIBUTION_ID
).
showBreakpointWidget
(
element
.
lineNumber
,
element
.
column
);
}
});
}));
actions
.
push
(
new
Separator
());
}
actions
.
push
(
new
RemoveBreakpointAction
(
RemoveBreakpointAction
.
ID
,
RemoveBreakpointAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
RemoveBreakpointAction
(
RemoveBreakpointAction
.
ID
,
RemoveBreakpointAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
if
(
this
.
debugService
.
getModel
().
getBreakpoints
().
length
+
this
.
debugService
.
getModel
().
getFunctionBreakpoints
().
length
>
1
)
{
if
(
this
.
debugService
.
getModel
().
getBreakpoints
().
length
+
this
.
debugService
.
getModel
().
getFunctionBreakpoints
().
length
>
1
)
{
actions
.
push
(
new
RemoveAllBreakpointsAction
(
RemoveAllBreakpointsAction
.
ID
,
RemoveAllBreakpointsAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
RemoveAllBreakpointsAction
(
RemoveAllBreakpointsAction
.
ID
,
RemoveAllBreakpointsAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
Separator
());
actions
.
push
(
new
Separator
());
...
@@ -130,7 +147,7 @@ export class BreakpointsView extends ViewsViewletPanel {
...
@@ -130,7 +147,7 @@ export class BreakpointsView extends ViewsViewletPanel {
this
.
contextMenuService
.
showContextMenu
({
this
.
contextMenuService
.
showContextMenu
({
getAnchor
:
()
=>
e
.
anchor
,
getAnchor
:
()
=>
e
.
anchor
,
getActions
:
()
=>
TPromise
.
as
(
actions
),
getActions
:
()
=>
TPromise
.
as
(
actions
),
getActionsContext
:
()
=>
e
.
e
lement
getActionsContext
:
()
=>
element
});
});
}
}
...
@@ -471,12 +488,11 @@ class FunctionBreakpointInputRenderer implements IRenderer<IFunctionBreakpoint,
...
@@ -471,12 +488,11 @@ class FunctionBreakpointInputRenderer implements IRenderer<IFunctionBreakpoint,
}
}
}
}
function
openBreakpointSource
(
breakpoint
:
Breakpoint
,
event
:
any
,
preserveFocus
:
boolean
,
debugService
:
IDebugService
,
editorService
:
IEditorService
):
void
{
function
openBreakpointSource
(
breakpoint
:
Breakpoint
,
sideBySide
:
boolean
,
preserveFocus
:
boolean
,
debugService
:
IDebugService
,
editorService
:
IEditorService
):
TPromise
<
IEditor
>
{
if
(
breakpoint
.
uri
.
scheme
===
DEBUG_SCHEME
&&
debugService
.
state
===
State
.
Inactive
)
{
if
(
breakpoint
.
uri
.
scheme
===
DEBUG_SCHEME
&&
debugService
.
state
===
State
.
Inactive
)
{
return
;
return
TPromise
.
as
(
null
)
;
}
}
const
sideBySide
=
(
event
&&
(
event
.
ctrlKey
||
event
.
metaKey
));
const
selection
=
breakpoint
.
endLineNumber
?
{
const
selection
=
breakpoint
.
endLineNumber
?
{
startLineNumber
:
breakpoint
.
lineNumber
,
startLineNumber
:
breakpoint
.
lineNumber
,
endLineNumber
:
breakpoint
.
endLineNumber
,
endLineNumber
:
breakpoint
.
endLineNumber
,
...
@@ -489,7 +505,7 @@ function openBreakpointSource(breakpoint: Breakpoint, event: any, preserveFocus:
...
@@ -489,7 +505,7 @@ function openBreakpointSource(breakpoint: Breakpoint, event: any, preserveFocus:
endColumn
:
breakpoint
.
column
||
Constants
.
MAX_SAFE_SMALL_INTEGER
endColumn
:
breakpoint
.
column
||
Constants
.
MAX_SAFE_SMALL_INTEGER
};
};
editorService
.
openEditor
({
return
editorService
.
openEditor
({
resource
:
breakpoint
.
uri
,
resource
:
breakpoint
.
uri
,
options
:
{
options
:
{
preserveFocus
,
preserveFocus
,
...
@@ -498,5 +514,5 @@ function openBreakpointSource(breakpoint: Breakpoint, event: any, preserveFocus:
...
@@ -498,5 +514,5 @@ function openBreakpointSource(breakpoint: Breakpoint, event: any, preserveFocus:
revealInCenterIfOutsideViewport
:
true
,
revealInCenterIfOutsideViewport
:
true
,
pinned
:
!
preserveFocus
pinned
:
!
preserveFocus
}
}
},
sideBySide
)
.
done
(
undefined
,
onUnexpectedError
)
;
},
sideBySide
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录