Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d1f43140
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,发现更多精彩内容 >>
提交
d1f43140
编写于
11月 29, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: cleanup how we create view controllers
上级
0dca3116
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
46 deletion
+32
-46
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
+21
-36
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
+4
-4
src/vs/workbench/parts/debug/electron-browser/repl.ts
src/vs/workbench/parts/debug/electron-browser/repl.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
+6
-5
未找到文件。
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
浏览文件 @
d1f43140
...
...
@@ -11,6 +11,7 @@ import * as paths from 'vs/base/common/paths';
import
*
as
async
from
'
vs/base/common/async
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
equalsIgnoreCase
}
from
'
vs/base/common/strings
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IMouseEvent
,
DragMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
...
...
@@ -21,16 +22,17 @@ import { ITree, IAccessibilityProvider, ContextMenuEvent, IDataSource, IRenderer
import
{
InputBox
,
IInputValidationOptions
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
DefaultController
,
DefaultDragAndDrop
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
IActionProvider
}
from
'
vs/base/parts/tree/browser/actionsRenderer
'
;
import
{
IContextViewService
,
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
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
,
ToggleBreakpointsActivatedAction
,
RestartFrameAction
,
AddToWatchExpressionsAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
CopyValueAction
}
from
'
vs/workbench/parts/debug/electron-browser/electronDebugActions
'
;
import
{
IContextViewService
,
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
Source
}
from
'
vs/workbench/parts/debug/common/debugSource
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
const
$
=
dom
.
$
;
const
booleanRegex
=
/^true|false$/i
;
...
...
@@ -176,10 +178,10 @@ function getSourceName(source: Source, contextService: IWorkspaceContextService)
export
class
BaseDebugController
extends
DefaultController
{
constructor
(
protected
debugService
:
debug
.
IDebugService
,
private
contextMenuService
:
IContextMenuService
,
private
actionProvider
:
IActionProvider
,
private
focusOnContextMenu
=
true
@
debug
.
IDebugService
protected
debugService
:
debug
.
IDebugService
,
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
)
{
super
();
...
...
@@ -189,6 +191,11 @@ export class BaseDebugController extends DefaultController {
this
.
downKeyBindingDispatcher
.
set
(
KeyCode
.
Delete
,
this
.
onDelete
.
bind
(
this
));
this
.
downKeyBindingDispatcher
.
set
(
KeyMod
.
Shift
|
KeyCode
.
Delete
,
this
.
onDelete
.
bind
(
this
));
}
if
(
isMacintosh
)
{
this
.
downKeyBindingDispatcher
.
set
(
KeyCode
.
Enter
,
this
.
onRename
.
bind
(
this
));
}
else
{
this
.
downKeyBindingDispatcher
.
set
(
KeyCode
.
F2
,
this
.
onRename
.
bind
(
this
));
}
}
public
onContextMenu
(
tree
:
ITree
,
element
:
debug
.
IEnablement
,
event
:
ContextMenuEvent
):
boolean
{
...
...
@@ -199,9 +206,7 @@ export class BaseDebugController extends DefaultController {
event
.
preventDefault
();
event
.
stopPropagation
();
if
(
this
.
focusOnContextMenu
)
{
tree
.
setFocus
(
element
);
}
tree
.
setFocus
(
element
);
if
(
this
.
actionProvider
.
hasSecondaryActions
(
tree
,
element
))
{
const
anchor
=
{
x
:
event
.
posx
+
1
,
y
:
event
.
posy
};
...
...
@@ -225,6 +230,10 @@ export class BaseDebugController extends DefaultController {
protected
onDelete
(
tree
:
ITree
,
event
:
IKeyboardEvent
):
boolean
{
return
false
;
}
protected
onRename
(
tree
:
ITree
,
event
:
IKeyboardEvent
):
boolean
{
return
false
;
}
}
// call stack
...
...
@@ -759,11 +768,6 @@ export class VariablesAccessibilityProvider implements IAccessibilityProvider {
export
class
VariablesController
extends
BaseDebugController
{
constructor
(
debugService
:
debug
.
IDebugService
,
contextMenuService
:
IContextMenuService
,
actionProvider
:
IActionProvider
)
{
super
(
debugService
,
contextMenuService
,
actionProvider
);
this
.
downKeyBindingDispatcher
.
set
(
KeyCode
.
Enter
,
this
.
setSelectedExpression
.
bind
(
this
));
}
protected
onLeftClick
(
tree
:
ITree
,
element
:
any
,
event
:
IMouseEvent
):
boolean
{
// double click on primitive value: open input box to be able to set the value
if
(
element
instanceof
Variable
&&
event
.
detail
===
2
)
{
...
...
@@ -777,7 +781,7 @@ export class VariablesController extends BaseDebugController {
return
super
.
onLeftClick
(
tree
,
element
,
event
);
}
protected
setSelectedExpression
(
tree
:
ITree
,
event
:
KeyboardEvent
):
boolean
{
protected
onEnter
(
tree
:
ITree
,
event
:
I
KeyboardEvent
):
boolean
{
const
element
=
tree
.
getFocus
();
if
(
element
instanceof
Variable
&&
!
element
.
hasChildren
)
{
this
.
debugService
.
getViewModel
().
setSelectedExpression
(
element
);
...
...
@@ -995,16 +999,6 @@ export class WatchExpressionsAccessibilityProvider implements IAccessibilityProv
export
class
WatchExpressionsController
extends
BaseDebugController
{
constructor
(
debugService
:
debug
.
IDebugService
,
contextMenuService
:
IContextMenuService
,
actionProvider
:
IActionProvider
)
{
super
(
debugService
,
contextMenuService
,
actionProvider
);
if
(
isMacintosh
)
{
this
.
downKeyBindingDispatcher
.
set
(
KeyCode
.
Enter
,
this
.
onRename
.
bind
(
this
));
}
else
{
this
.
downKeyBindingDispatcher
.
set
(
KeyCode
.
F2
,
this
.
onRename
.
bind
(
this
));
}
}
protected
onLeftClick
(
tree
:
ITree
,
element
:
any
,
event
:
IMouseEvent
):
boolean
{
// double click on primitive value: open input box to be able to select and copy value.
if
(
element
instanceof
Expression
&&
event
.
detail
===
2
)
{
...
...
@@ -1018,7 +1012,7 @@ export class WatchExpressionsController extends BaseDebugController {
return
super
.
onLeftClick
(
tree
,
element
,
event
);
}
protected
onRename
(
tree
:
ITree
,
event
:
KeyboardEvent
):
boolean
{
protected
onRename
(
tree
:
ITree
,
event
:
I
KeyboardEvent
):
boolean
{
const
element
=
tree
.
getFocus
();
if
(
element
instanceof
Expression
)
{
const
watchExpression
=
<
Expression
>
element
;
...
...
@@ -1328,15 +1322,6 @@ export class BreakpointsAccessibilityProvider implements IAccessibilityProvider
export
class
BreakpointsController
extends
BaseDebugController
{
constructor
(
debugService
:
debug
.
IDebugService
,
contextMenuService
:
IContextMenuService
,
actionProvider
:
IActionProvider
)
{
super
(
debugService
,
contextMenuService
,
actionProvider
);
if
(
isMacintosh
)
{
this
.
downKeyBindingDispatcher
.
set
(
KeyCode
.
Enter
,
this
.
onRename
.
bind
(
this
));
}
else
{
this
.
downKeyBindingDispatcher
.
set
(
KeyCode
.
F2
,
this
.
onRename
.
bind
(
this
));
}
}
protected
onLeftClick
(
tree
:
ITree
,
element
:
any
,
event
:
IMouseEvent
):
boolean
{
if
(
element
instanceof
FunctionBreakpoint
&&
event
.
detail
===
2
)
{
this
.
debugService
.
getViewModel
().
setSelectedFunctionBreakpoint
(
element
);
...
...
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
浏览文件 @
d1f43140
...
...
@@ -86,7 +86,7 @@ export class VariablesView extends CollapsibleViewletView {
dataSource
:
new
viewer
.
VariablesDataSource
(),
renderer
:
this
.
instantiationService
.
createInstance
(
viewer
.
VariablesRenderer
),
accessibilityProvider
:
new
viewer
.
VariablesAccessibilityProvider
(),
controller
:
new
viewer
.
VariablesController
(
this
.
debugService
,
this
.
contextMenuService
,
new
viewer
.
VariablesActionProvider
(
this
.
instantiationService
))
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
VariablesController
,
new
viewer
.
VariablesActionProvider
(
this
.
instantiationService
))
},
{
ariaLabel
:
nls
.
localize
(
'
variablesAriaTreeLabel
'
,
"
Debug Variables
"
),
twistiePixels
...
...
@@ -182,7 +182,7 @@ export class WatchExpressionsView extends CollapsibleViewletView {
dataSource
:
new
viewer
.
WatchExpressionsDataSource
(),
renderer
:
this
.
instantiationService
.
createInstance
(
viewer
.
WatchExpressionsRenderer
,
actionProvider
,
this
.
actionRunner
),
accessibilityProvider
:
new
viewer
.
WatchExpressionsAccessibilityProvider
(),
controller
:
new
viewer
.
WatchExpressionsController
(
this
.
debugService
,
this
.
contextMenuService
,
actionProvider
),
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
WatchExpressionsController
,
actionProvider
),
dnd
:
this
.
instantiationService
.
createInstance
(
viewer
.
WatchExpressionsDragAndDrop
)
},
{
ariaLabel
:
nls
.
localize
({
comment
:
[
'
Debug is a noun in this context, not a verb.
'
],
key
:
'
watchAriaTreeLabel
'
},
"
Debug Watch Expressions
"
),
...
...
@@ -301,7 +301,7 @@ export class CallStackView extends CollapsibleViewletView {
dataSource
:
this
.
instantiationService
.
createInstance
(
viewer
.
CallStackDataSource
),
renderer
:
this
.
instantiationService
.
createInstance
(
viewer
.
CallStackRenderer
),
accessibilityProvider
:
this
.
instantiationService
.
createInstance
(
viewer
.
CallstackAccessibilityProvider
),
controller
:
new
viewer
.
CallStackController
(
this
.
debugService
,
this
.
contextMenuService
,
actionProvider
)
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
CallStackController
,
actionProvider
)
},
{
ariaLabel
:
nls
.
localize
({
comment
:
[
'
Debug is a noun in this context, not a verb.
'
],
key
:
'
callStackAriaLabel
'
},
"
Debug Call Stack
"
),
twistiePixels
...
...
@@ -361,7 +361,7 @@ export class BreakpointsView extends AdaptiveCollapsibleViewletView {
dataSource
:
new
viewer
.
BreakpointsDataSource
(),
renderer
:
this
.
instantiationService
.
createInstance
(
viewer
.
BreakpointsRenderer
,
actionProvider
,
this
.
actionRunner
),
accessibilityProvider
:
this
.
instantiationService
.
createInstance
(
viewer
.
BreakpointsAccessibilityProvider
),
controller
:
new
viewer
.
BreakpointsController
(
this
.
debugService
,
this
.
contextMenuService
,
actionProvider
),
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
BreakpointsController
,
actionProvider
),
sorter
:
{
compare
(
tree
:
ITree
,
element
:
any
,
otherElement
:
any
):
number
{
const
first
=
<
IBreakpoint
>
element
;
...
...
src/vs/workbench/parts/debug/electron-browser/repl.ts
浏览文件 @
d1f43140
...
...
@@ -143,7 +143,7 @@ export class Repl extends Panel implements IPrivateReplService {
dataSource
:
new
ReplExpressionsDataSource
(),
renderer
:
this
.
renderer
,
accessibilityProvider
:
new
ReplExpressionsAccessibilityProvider
(),
controller
:
new
ReplExpressionsController
(
this
.
debugService
,
this
.
contextMenuService
,
new
ReplExpressionsActionProvider
(
this
.
instantiationService
),
this
.
replInput
,
false
)
controller
:
this
.
instantiationService
.
createInstance
(
ReplExpressionsController
,
this
.
replInput
,
new
ReplExpressionsActionProvider
(
this
.
instantiationService
)
)
},
replTreeOptions
);
if
(
!
Repl
.
HISTORY
)
{
...
...
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
浏览文件 @
d1f43140
...
...
@@ -26,6 +26,7 @@ import { AddToWatchExpressionsAction, ClearReplAction } from 'vs/workbench/parts
import
{
CopyAction
}
from
'
vs/workbench/parts/debug/electron-browser/electronDebugActions
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
...
...
@@ -496,13 +497,13 @@ export class ReplExpressionsController extends BaseDebugController {
private
lastSelectedString
:
string
=
null
;
constructor
(
debugService
:
IDebugService
,
contextMenuService
:
IContextMenuService
,
actionProvider
:
IActionProvider
,
private
replInput
:
ICodeEditor
,
focusOnContextMenu
=
true
actionProvider
:
IActionProvider
,
@
IDebugService
debugService
:
IDebugService
,
@
IContextMenuService
contextMenuService
:
IContextMenuService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
)
{
super
(
debugService
,
contextMenuService
,
actionProvider
,
focusOnContextMenu
);
super
(
actionProvider
,
debugService
,
contextMenuService
,
contextKeyService
);
}
protected
onLeftClick
(
tree
:
ITree
,
element
:
any
,
eventish
:
ICancelableEvent
,
origin
:
string
=
'
mouse
'
):
boolean
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录