Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4198b4ec
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,发现更多精彩内容 >>
提交
4198b4ec
编写于
2月 07, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug debt: introduce debug.openBreakpointToSide
上级
d220977e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
21 deletion
+31
-21
src/vs/workbench/parts/debug/electron-browser/breakpointsView.ts
...workbench/parts/debug/electron-browser/breakpointsView.ts
+10
-21
src/vs/workbench/parts/debug/electron-browser/debugCommands.ts
...s/workbench/parts/debug/electron-browser/debugCommands.ts
+21
-0
未找到文件。
src/vs/workbench/parts/debug/electron-browser/breakpointsView.ts
浏览文件 @
4198b4ec
...
@@ -26,7 +26,7 @@ import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
...
@@ -26,7 +26,7 @@ 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
,
IEditor
}
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
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
WorkbenchList
}
from
'
vs/platform/list/browser/listService
'
;
import
{
WorkbenchList
}
from
'
vs/platform/list/browser/listService
'
;
import
{
ViewsViewletPanel
,
IViewletViewOptions
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
import
{
ViewsViewletPanel
,
IViewletViewOptions
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
...
@@ -78,17 +78,6 @@ export class BreakpointsView extends ViewsViewletPanel {
...
@@ -78,17 +78,6 @@ export class BreakpointsView extends ViewsViewletPanel {
this
.
list
.
onContextMenu
(
this
.
onListContextMenu
,
this
,
this
.
disposables
);
this
.
list
.
onContextMenu
(
this
.
onListContextMenu
,
this
,
this
.
disposables
);
const
handleBreakpointFocus
=
(
preserveFocus
:
boolean
,
sideBySide
:
boolean
,
selectFunctionBreakpoint
:
boolean
)
=>
{
const
focused
=
this
.
list
.
getFocusedElements
();
const
element
=
focused
.
length
?
focused
[
0
]
:
undefined
;
if
(
element
instanceof
Breakpoint
)
{
openBreakpointSource
(
element
,
sideBySide
,
preserveFocus
,
this
.
debugService
,
this
.
editorService
).
done
(
undefined
,
onUnexpectedError
);
}
if
(
selectFunctionBreakpoint
&&
element
instanceof
FunctionBreakpoint
&&
element
!==
this
.
debugService
.
getViewModel
().
getSelectedFunctionBreakpoint
())
{
this
.
debugService
.
getViewModel
().
setSelectedFunctionBreakpoint
(
element
);
this
.
onBreakpointsChange
();
}
};
this
.
disposables
.
push
(
this
.
list
.
onOpen
(
e
=>
{
this
.
disposables
.
push
(
this
.
list
.
onOpen
(
e
=>
{
let
isSingleClick
=
false
;
let
isSingleClick
=
false
;
let
isDoubleClick
=
false
;
let
isDoubleClick
=
false
;
...
@@ -101,14 +90,14 @@ export class BreakpointsView extends ViewsViewletPanel {
...
@@ -101,14 +90,14 @@ export class BreakpointsView extends ViewsViewletPanel {
openToSide
=
(
browserEvent
.
ctrlKey
||
browserEvent
.
metaKey
||
browserEvent
.
altKey
);
openToSide
=
(
browserEvent
.
ctrlKey
||
browserEvent
.
metaKey
||
browserEvent
.
altKey
);
}
}
handleBreakpointFocus
(
isSingleClick
,
openToSide
,
isDoubleClick
);
const
focused
=
this
.
list
.
getFocusedElements
(
);
}))
;
const
element
=
focused
.
length
?
focused
[
0
]
:
undefined
;
if
(
element
instanceof
Breakpoint
)
{
// TODO@Isidor this should be a command (breakpoints.openToSide)
openBreakpointSource
(
element
,
openToSide
,
isSingleClick
,
this
.
debugService
,
this
.
editorService
).
done
(
undefined
,
onUnexpectedError
);
this
.
disposables
.
push
(
this
.
list
.
onKeyUp
(
e
=>
{
}
const
event
=
new
StandardKeyboardEvent
(
e
);
if
(
isDoubleClick
&&
element
instanceof
FunctionBreakpoint
&&
element
!==
this
.
debugService
.
getViewModel
().
getSelectedFunctionBreakpoint
())
{
if
(
event
.
equals
(
KeyCode
.
Enter
)
&&
(
event
.
ctrlKey
||
event
.
metaKey
||
event
.
altKey
))
{
this
.
debugService
.
getViewModel
().
setSelectedFunctionBreakpoint
(
element
);
handleBreakpointFocus
(
false
,
true
,
false
);
this
.
onBreakpointsChange
(
);
}
}
}));
}));
...
@@ -495,7 +484,7 @@ class FunctionBreakpointInputRenderer implements IRenderer<IFunctionBreakpoint,
...
@@ -495,7 +484,7 @@ class FunctionBreakpointInputRenderer implements IRenderer<IFunctionBreakpoint,
}
}
}
}
function
openBreakpointSource
(
breakpoint
:
Breakpoint
,
sideBySide
:
boolean
,
preserveFocus
:
boolean
,
debugService
:
IDebugService
,
editorService
:
IEditorService
):
TPromise
<
IEditor
>
{
export
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
TPromise
.
as
(
null
);
return
TPromise
.
as
(
null
);
}
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugCommands.ts
浏览文件 @
4198b4ec
...
@@ -23,6 +23,7 @@ import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
...
@@ -23,6 +23,7 @@ import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
openBreakpointSource
}
from
'
vs/workbench/parts/debug/electron-browser/breakpointsView
'
;
export
function
registerCommands
():
void
{
export
function
registerCommands
():
void
{
...
@@ -215,4 +216,24 @@ export function registerCommands(): void {
...
@@ -215,4 +216,24 @@ export function registerCommands(): void {
group
:
'
debug
'
,
group
:
'
debug
'
,
order
:
1
order
:
1
});
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
debug.openBreakpointToSide
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(),
when
:
CONTEXT_BREAKPOINTS_FOCUSED
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
Enter
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
Enter
],
handler
:
(
accessor
)
=>
{
const
listService
=
accessor
.
get
(
IListService
);
const
list
=
listService
.
lastFocusedList
;
if
(
list
instanceof
List
)
{
const
focus
=
list
.
getFocusedElements
();
if
(
focus
.
length
&&
focus
[
0
]
instanceof
Breakpoint
)
{
return
openBreakpointSource
(
focus
[
0
],
true
,
false
,
accessor
.
get
(
IDebugService
),
accessor
.
get
(
IWorkbenchEditorService
));
}
}
return
TPromise
.
as
(
undefined
);
}
});
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录