Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
78d5ff8a
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,发现更多精彩内容 >>
提交
78d5ff8a
编写于
11月 21, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: reduce usages of instantiation service
上级
3afa3348
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
67 addition
and
64 deletion
+67
-64
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
+17
-15
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
...parts/debug/electron-browser/debugConfigurationManager.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
...h/parts/debug/electron-browser/debugEditorContribution.ts
+8
-6
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
+30
-31
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
+11
-11
未找到文件。
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
浏览文件 @
78d5ff8a
...
...
@@ -19,7 +19,6 @@ import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import
{
IDebugConfiguration
,
IDebugService
,
State
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
AbstractDebugAction
,
PauseAction
,
ContinueAction
,
StepBackAction
,
ReverseContinueAction
,
StopAction
,
DisconnectAction
,
StepOverAction
,
StepIntoAction
,
StepOutAction
,
RestartAction
,
FocusProcessAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
FocusProcessActionItem
}
from
'
vs/workbench/parts/debug/browser/debugActionItems
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IConfigurationService
,
IConfigurationChangeEvent
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
...
...
@@ -28,6 +27,8 @@ import { Themable } from 'vs/workbench/common/theme';
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
registerColor
,
contrastBorder
,
widgetShadow
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
const
$
=
builder
.
$
;
const
DEBUG_ACTIONS_WIDGET_POSITION_KEY
=
'
debug.actionswidgetposition
'
;
...
...
@@ -53,11 +54,12 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
@
IMessageService
private
messageService
:
IMessageService
,
@
ITelemetryService
private
telemetryService
:
ITelemetryService
,
@
IDebugService
private
debugService
:
IDebugService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IPartService
private
partService
:
IPartService
,
@
IStorageService
private
storageService
:
IStorageService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IThemeService
themeService
:
IThemeService
@
IThemeService
themeService
:
IThemeService
,
@
IKeybindingService
private
keybindingService
:
IKeybindingService
,
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
)
{
super
(
themeService
);
...
...
@@ -73,7 +75,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
orientation
:
ActionsOrientation
.
HORIZONTAL
,
actionItemProvider
:
(
action
:
IAction
)
=>
{
if
(
action
.
id
===
FocusProcessAction
.
ID
)
{
return
this
.
instantiationService
.
createInstance
(
FocusProcessActionItem
,
action
);
return
new
FocusProcessActionItem
(
action
,
this
.
debugService
,
this
.
themeService
);
}
return
null
;
...
...
@@ -231,17 +233,17 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
private
getActions
():
AbstractDebugAction
[]
{
if
(
!
this
.
allActions
)
{
this
.
allActions
=
[];
this
.
allActions
.
push
(
this
.
instantiationService
.
createInstance
(
ContinueAction
,
ContinueAction
.
ID
,
ContinueAction
.
LABEL
));
this
.
allActions
.
push
(
this
.
instantiationService
.
createInstance
(
PauseAction
,
PauseAction
.
ID
,
PauseAction
.
LABEL
));
this
.
allActions
.
push
(
this
.
instantiationService
.
createInstance
(
StopAction
,
StopAction
.
ID
,
StopAction
.
LABEL
));
this
.
allActions
.
push
(
this
.
instantiationService
.
createInstance
(
DisconnectAction
,
DisconnectAction
.
ID
,
DisconnectAction
.
LABEL
));
this
.
allActions
.
push
(
this
.
instantiationService
.
createInstance
(
StepOverAction
,
StepOverAction
.
ID
,
StepOverAction
.
LABEL
));
this
.
allActions
.
push
(
this
.
instantiationService
.
createInstance
(
StepIntoAction
,
StepIntoAction
.
ID
,
StepIntoAction
.
LABEL
));
this
.
allActions
.
push
(
this
.
instantiationService
.
createInstance
(
StepOutAction
,
StepOutAction
.
ID
,
StepOutAction
.
LABEL
));
this
.
allActions
.
push
(
this
.
instantiationService
.
createInstance
(
RestartAction
,
RestartAction
.
ID
,
RestartAction
.
LABEL
));
this
.
allActions
.
push
(
this
.
instantiationService
.
createInstance
(
StepBackAction
,
StepBackAction
.
ID
,
StepBackAction
.
LABEL
));
this
.
allActions
.
push
(
this
.
instantiationService
.
createInstance
(
ReverseContinueAction
,
ReverseContinueAction
.
ID
,
ReverseContinueAction
.
LABEL
));
this
.
allActions
.
push
(
this
.
instantiationService
.
createInstance
(
FocusProcessAction
,
FocusProcessAction
.
ID
,
FocusProcessAction
.
LABEL
));
this
.
allActions
.
push
(
new
ContinueAction
(
ContinueAction
.
ID
,
ContinueAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
this
.
allActions
.
push
(
new
PauseAction
(
PauseAction
.
ID
,
PauseAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
this
.
allActions
.
push
(
new
StopAction
(
StopAction
.
ID
,
StopAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
this
.
allActions
.
push
(
new
DisconnectAction
(
DisconnectAction
.
ID
,
DisconnectAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
this
.
allActions
.
push
(
new
StepOverAction
(
StepOverAction
.
ID
,
StepOverAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
this
.
allActions
.
push
(
new
StepIntoAction
(
StepIntoAction
.
ID
,
StepIntoAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
this
.
allActions
.
push
(
new
StepOutAction
(
StepOutAction
.
ID
,
StepOutAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
this
.
allActions
.
push
(
new
RestartAction
(
RestartAction
.
ID
,
RestartAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
this
.
allActions
.
push
(
new
StepBackAction
(
StepBackAction
.
ID
,
StepBackAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
this
.
allActions
.
push
(
new
ReverseContinueAction
(
ReverseContinueAction
.
ID
,
ReverseContinueAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
this
.
allActions
.
push
(
new
FocusProcessAction
(
FocusProcessAction
.
ID
,
FocusProcessAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
,
this
.
editorService
));
this
.
allActions
.
forEach
(
a
=>
{
this
.
toUnbind
.
push
(
a
);
});
...
...
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
浏览文件 @
78d5ff8a
...
...
@@ -292,7 +292,7 @@ export class ConfigurationManager implements IConfigurationManager {
if
(
duplicate
)
{
duplicate
.
merge
(
rawAdapter
,
extension
.
description
);
}
else
{
this
.
adapters
.
push
(
this
.
instantiationService
.
createInstance
(
Adapter
,
rawAdapter
,
extension
.
description
));
this
.
adapters
.
push
(
new
Adapter
(
rawAdapter
,
extension
.
description
,
this
.
configurationService
,
this
.
commandService
));
}
});
});
...
...
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
浏览文件 @
78d5ff8a
...
...
@@ -40,6 +40,7 @@ import { Position } from 'vs/editor/common/core/position';
import
{
CoreEditingCommands
}
from
'
vs/editor/browser/controller/coreCommands
'
;
import
{
first
}
from
'
vs/base/common/arrays
'
;
import
{
IMarginData
}
from
'
vs/editor/browser/controller/mouseTarget
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
const
HOVER_DELAY
=
300
;
const
LAUNCH_JSON_REGEX
=
/launch
\.
json$/
;
...
...
@@ -78,7 +79,8 @@ export class DebugEditorContribution implements IDebugEditorContribution {
@
ITelemetryService
private
telemetryService
:
ITelemetryService
,
@
IListService
listService
:
IListService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IThemeService
themeService
:
IThemeService
@
IThemeService
themeService
:
IThemeService
,
@
IKeybindingService
private
keybindingService
:
IKeybindingService
)
{
this
.
breakpointHintDecoration
=
[];
this
.
hoverWidget
=
new
DebugHoverWidget
(
this
.
editor
,
this
.
debugService
,
listService
,
this
.
instantiationService
,
themeService
);
...
...
@@ -96,12 +98,12 @@ export class DebugEditorContribution implements IDebugEditorContribution {
private
getContextMenuActions
(
breakpoints
:
IBreakpoint
[],
uri
:
uri
,
lineNumber
:
number
):
TPromise
<
(
IAction
|
ContextSubMenu
)[]
>
{
const
actions
:
(
IAction
|
ContextSubMenu
)[]
=
[];
if
(
breakpoints
.
length
===
1
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RemoveBreakpointAction
,
RemoveBreakpointAction
.
ID
,
RemoveBreakpointAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
EditConditionalBreakpointAction
,
EditConditionalBreakpointAction
.
ID
,
EditConditionalBreakpointAction
.
LABEL
,
this
.
editor
));
actions
.
push
(
new
RemoveBreakpointAction
(
RemoveBreakpointAction
.
ID
,
RemoveBreakpointAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
EditConditionalBreakpointAction
(
EditConditionalBreakpointAction
.
ID
,
EditConditionalBreakpointAction
.
LABEL
,
this
.
editor
,
this
.
debugService
,
this
.
keybindingService
));
if
(
breakpoints
[
0
].
enabled
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
DisableBreakpointAction
,
DisableBreakpointAction
.
ID
,
DisableBreakpointAction
.
LABEL
));
actions
.
push
(
new
DisableBreakpointAction
(
DisableBreakpointAction
.
ID
,
DisableBreakpointAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
}
else
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
EnableBreakpointAction
,
EnableBreakpointAction
.
ID
,
EnableBreakpointAction
.
LABEL
));
actions
.
push
(
new
EnableBreakpointAction
(
EnableBreakpointAction
.
ID
,
EnableBreakpointAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
}
}
else
if
(
breakpoints
.
length
>
1
)
{
const
sorted
=
breakpoints
.
sort
((
first
,
second
)
=>
first
.
column
-
second
.
column
);
...
...
@@ -138,7 +140,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
true
,
()
=>
this
.
debugService
.
addBreakpoints
(
uri
,
[{
lineNumber
}])
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
AddConditionalBreakpointAction
,
AddConditionalBreakpointAction
.
ID
,
AddConditionalBreakpointAction
.
LABEL
,
this
.
editor
,
lineNumber
));
actions
.
push
(
new
AddConditionalBreakpointAction
(
AddConditionalBreakpointAction
.
ID
,
AddConditionalBreakpointAction
.
LABEL
,
this
.
editor
,
lineNumber
,
this
.
debugService
,
this
.
keybindingService
));
}
return
TPromise
.
as
(
actions
);
...
...
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
浏览文件 @
78d5ff8a
...
...
@@ -22,7 +22,6 @@ import { InputBox, IInputValidationOptions } from 'vs/base/browser/ui/inputbox/i
import
{
DefaultController
,
DefaultDragAndDrop
,
ClickBehavior
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
Constants
}
from
'
vs/editor/common/core/uint
'
;
import
{
IContextViewService
,
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IMenuService
,
IMenu
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
...
...
@@ -38,6 +37,7 @@ import { once } from 'vs/base/common/functional';
import
{
attachInputBoxStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
const
$
=
dom
.
$
;
const
booleanRegex
=
/^true|false$/i
;
...
...
@@ -310,7 +310,7 @@ export class CallStackController extends BaseDebugController {
export
class
CallStackActionProvider
implements
IActionProvider
{
constructor
(
@
IInstantiationService
private
instantiationService
:
IInstantiation
Service
)
{
constructor
(
private
debugService
:
debug
.
IDebugService
,
private
keybindingService
:
IKeybinding
Service
)
{
// noop
}
...
...
@@ -329,21 +329,21 @@ export class CallStackActionProvider implements IActionProvider {
public
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
TPromise
<
IAction
[]
>
{
const
actions
:
IAction
[]
=
[];
if
(
element
instanceof
Process
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RestartAction
,
RestartAction
.
ID
,
RestartAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
StopAction
,
StopAction
.
ID
,
StopAction
.
LABEL
));
actions
.
push
(
new
RestartAction
(
RestartAction
.
ID
,
RestartAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
StopAction
(
StopAction
.
ID
,
StopAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
}
else
if
(
element
instanceof
Thread
)
{
const
thread
=
<
Thread
>
element
;
if
(
thread
.
stopped
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
ContinueAction
,
ContinueAction
.
ID
,
ContinueAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
StepOverAction
,
StepOverAction
.
ID
,
StepOverAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
StepIntoAction
,
StepIntoAction
.
ID
,
StepIntoAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
StepOutAction
,
StepOutAction
.
ID
,
StepOutAction
.
LABEL
));
actions
.
push
(
new
ContinueAction
(
ContinueAction
.
ID
,
ContinueAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
StepOverAction
(
StepOverAction
.
ID
,
StepOverAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
StepIntoAction
(
StepIntoAction
.
ID
,
StepIntoAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
StepOutAction
(
StepOutAction
.
ID
,
StepOutAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
}
else
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
PauseAction
,
PauseAction
.
ID
,
PauseAction
.
LABEL
));
actions
.
push
(
new
PauseAction
(
PauseAction
.
ID
,
PauseAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
}
}
else
if
(
element
instanceof
StackFrame
)
{
if
(
element
.
thread
.
process
.
session
.
capabilities
.
supportsRestartFrame
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RestartFrameAction
,
RestartFrameAction
.
ID
,
RestartFrameAction
.
LABEL
));
actions
.
push
(
new
RestartFrameAction
(
RestartFrameAction
.
ID
,
RestartFrameAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
}
actions
.
push
(
new
CopyStackTraceAction
(
CopyStackTraceAction
.
ID
,
CopyStackTraceAction
.
LABEL
));
}
...
...
@@ -616,7 +616,7 @@ export class CallstackAccessibilityProvider implements IAccessibilityProvider {
export
class
VariablesActionProvider
implements
IActionProvider
{
constructor
(
private
instantiationService
:
IInstantiation
Service
)
{
constructor
(
private
debugService
:
debug
.
IDebugService
,
private
keybindingService
:
IKeybinding
Service
)
{
// noop
}
...
...
@@ -636,10 +636,10 @@ export class VariablesActionProvider implements IActionProvider {
public
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
TPromise
<
IAction
[]
>
{
const
actions
:
IAction
[]
=
[];
const
variable
=
<
Variable
>
element
;
actions
.
push
(
this
.
instantiationService
.
createInstance
(
SetValueAction
,
SetValueAction
.
ID
,
SetValueAction
.
LABEL
,
variabl
e
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
CopyValueAction
,
CopyValueAction
.
ID
,
CopyValueAction
.
LABEL
,
variabl
e
));
actions
.
push
(
new
SetValueAction
(
SetValueAction
.
ID
,
SetValueAction
.
LABEL
,
variable
,
this
.
debugService
,
this
.
keybindingServic
e
));
actions
.
push
(
new
CopyValueAction
(
CopyValueAction
.
ID
,
CopyValueAction
.
LABEL
,
variable
,
this
.
debugServic
e
));
actions
.
push
(
new
Separator
());
actions
.
push
(
this
.
instantiationService
.
createInstance
(
AddToWatchExpressionsAction
,
AddToWatchExpressionsAction
.
ID
,
AddToWatchExpressionsAction
.
LABEL
,
variabl
e
));
actions
.
push
(
new
AddToWatchExpressionsAction
(
AddToWatchExpressionsAction
.
ID
,
AddToWatchExpressionsAction
.
LABEL
,
variable
,
this
.
debugService
,
this
.
keybindingServic
e
));
return
TPromise
.
as
(
actions
);
}
...
...
@@ -794,10 +794,9 @@ export class VariablesController extends BaseDebugController {
export
class
WatchExpressionsActionProvider
implements
IActionProvider
{
private
instantiationService
:
IInstantiationService
;
constructor
(
instantiationService
:
IInstantiation
Service
)
{
this
.
instantiationService
=
instantiationService
;
constructor
(
private
debugService
:
debug
.
IDebugService
,
private
keybindingService
:
IKeybinding
Service
)
{
// noop
}
public
hasActions
(
tree
:
ITree
,
element
:
any
):
boolean
{
...
...
@@ -816,25 +815,25 @@ export class WatchExpressionsActionProvider implements IActionProvider {
const
actions
:
IAction
[]
=
[];
if
(
element
instanceof
Expression
)
{
const
expression
=
<
Expression
>
element
;
actions
.
push
(
this
.
instantiationService
.
createInstance
(
AddWatchExpressionAction
,
AddWatchExpressionAction
.
ID
,
AddWatchExpressionAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
EditWatchExpressionAction
,
EditWatchExpressionAction
.
ID
,
EditWatchExpressionAction
.
LABEL
));
actions
.
push
(
new
AddWatchExpressionAction
(
AddWatchExpressionAction
.
ID
,
AddWatchExpressionAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
EditWatchExpressionAction
(
EditWatchExpressionAction
.
ID
,
EditWatchExpressionAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
if
(
!
expression
.
hasChildren
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
CopyValueAction
,
CopyValueAction
.
ID
,
CopyValueAction
.
LABEL
,
expression
.
valu
e
));
actions
.
push
(
new
CopyValueAction
(
CopyValueAction
.
ID
,
CopyValueAction
.
LABEL
,
expression
.
value
,
this
.
debugServic
e
));
}
actions
.
push
(
new
Separator
());
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RemoveWatchExpressionAction
,
RemoveWatchExpressionAction
.
ID
,
RemoveWatchExpressionAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RemoveAllWatchExpressionsAction
,
RemoveAllWatchExpressionsAction
.
ID
,
RemoveAllWatchExpressionsAction
.
LABEL
));
actions
.
push
(
new
RemoveWatchExpressionAction
(
RemoveWatchExpressionAction
.
ID
,
RemoveWatchExpressionAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
RemoveAllWatchExpressionsAction
(
RemoveAllWatchExpressionsAction
.
ID
,
RemoveAllWatchExpressionsAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
}
else
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
AddWatchExpressionAction
,
AddWatchExpressionAction
.
ID
,
AddWatchExpressionAction
.
LABEL
));
actions
.
push
(
new
AddWatchExpressionAction
(
AddWatchExpressionAction
.
ID
,
AddWatchExpressionAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
if
(
element
instanceof
Variable
)
{
const
variable
=
<
Variable
>
element
;
if
(
!
variable
.
hasChildren
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
CopyValueAction
,
CopyValueAction
.
ID
,
CopyValueAction
.
LABEL
,
variable
.
valu
e
));
actions
.
push
(
new
CopyValueAction
(
CopyValueAction
.
ID
,
CopyValueAction
.
LABEL
,
variable
.
value
,
this
.
debugServic
e
));
}
actions
.
push
(
new
Separator
());
}
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RemoveAllWatchExpressionsAction
,
RemoveAllWatchExpressionsAction
.
ID
,
RemoveAllWatchExpressionsAction
.
LABEL
));
actions
.
push
(
new
RemoveAllWatchExpressionsAction
(
RemoveAllWatchExpressionsAction
.
ID
,
RemoveAllWatchExpressionsAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
}
return
TPromise
.
as
(
actions
);
...
...
@@ -1045,7 +1044,7 @@ export class WatchExpressionsDragAndDrop extends DefaultDragAndDrop {
export
class
BreakpointsActionProvider
implements
IActionProvider
{
constructor
(
private
instantiationService
:
IInstantiationService
,
private
debugService
:
debug
.
IDebu
gService
)
{
constructor
(
private
debugService
:
debug
.
IDebugService
,
private
keybindingService
:
IKeybindin
gService
)
{
// noop
}
...
...
@@ -1067,17 +1066,17 @@ export class BreakpointsActionProvider implements IActionProvider {
}
const
actions
:
IAction
[]
=
[];
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RemoveBreakpointAction
,
RemoveBreakpointAction
.
ID
,
RemoveBreakpointAction
.
LABEL
));
actions
.
push
(
new
RemoveBreakpointAction
(
RemoveBreakpointAction
.
ID
,
RemoveBreakpointAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
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
RemoveAllBreakpointsAction
(
RemoveAllBreakpointsAction
.
ID
,
RemoveAllBreakpointsAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
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
EnableAllBreakpointsAction
(
EnableAllBreakpointsAction
.
ID
,
EnableAllBreakpointsAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
DisableAllBreakpointsAction
(
DisableAllBreakpointsAction
.
ID
,
DisableAllBreakpointsAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
}
actions
.
push
(
new
Separator
());
actions
.
push
(
this
.
instantiationService
.
createInstance
(
ReapplyBreakpointsAction
,
ReapplyBreakpointsAction
.
ID
,
ReapplyBreakpointsAction
.
LABEL
));
actions
.
push
(
new
ReapplyBreakpointsAction
(
ReapplyBreakpointsAction
.
ID
,
ReapplyBreakpointsAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
return
TPromise
.
as
(
actions
);
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
浏览文件 @
78d5ff8a
...
...
@@ -99,7 +99,7 @@ export class VariablesView extends ViewsViewletPanel {
dataSource
:
new
viewer
.
VariablesDataSource
(),
renderer
:
this
.
instantiationService
.
createInstance
(
viewer
.
VariablesRenderer
),
accessibilityProvider
:
new
viewer
.
VariablesAccessibilityProvider
(),
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
VariablesController
,
new
viewer
.
VariablesActionProvider
(
this
.
instantiation
Service
),
MenuId
.
DebugVariablesContext
)
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
VariablesController
,
new
viewer
.
VariablesActionProvider
(
this
.
debugService
,
this
.
keybinding
Service
),
MenuId
.
DebugVariablesContext
)
},
{
ariaLabel
:
nls
.
localize
(
'
variablesAriaTreeLabel
'
,
"
Debug Variables
"
),
twistiePixels
,
...
...
@@ -113,7 +113,7 @@ export class VariablesView extends ViewsViewletPanel {
this
.
tree
.
setInput
(
viewModel
);
const
collapseAction
=
this
.
instantiationService
.
createInstance
(
CollapseAction
,
this
.
tree
,
false
,
'
explorer-action collapse-explorer
'
);
const
collapseAction
=
new
CollapseAction
(
this
.
tree
,
false
,
'
explorer-action collapse-explorer
'
);
this
.
toolbar
.
setActions
(
prepareActions
([
collapseAction
]))();
this
.
disposables
.
push
(
viewModel
.
onDidFocusStackFrame
(
sf
=>
{
...
...
@@ -164,9 +164,9 @@ export class WatchExpressionsView extends ViewsViewletPanel {
@
IContextMenuService
contextMenuService
:
IContextMenuService
,
@
IDebugService
private
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IListService
private
listService
:
IListService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IThemeService
private
themeService
:
IThemeService
)
{
super
({
...(
options
as
IViewOptions
),
ariaHeaderLabel
:
nls
.
localize
(
'
expressionsSection
'
,
"
Expressions Section
"
)
},
keybindingService
,
contextMenuService
);
...
...
@@ -191,7 +191,7 @@ export class WatchExpressionsView extends ViewsViewletPanel {
dom
.
addClass
(
container
,
'
debug-watch
'
);
this
.
treeContainer
=
renderViewTree
(
container
);
const
actionProvider
=
new
viewer
.
WatchExpressionsActionProvider
(
this
.
instantiation
Service
);
const
actionProvider
=
new
viewer
.
WatchExpressionsActionProvider
(
this
.
debugService
,
this
.
keybinding
Service
);
this
.
tree
=
new
Tree
(
this
.
treeContainer
,
{
dataSource
:
new
viewer
.
WatchExpressionsDataSource
(),
renderer
:
this
.
instantiationService
.
createInstance
(
viewer
.
WatchExpressionsRenderer
),
...
...
@@ -209,9 +209,9 @@ export class WatchExpressionsView extends ViewsViewletPanel {
this
.
tree
.
setInput
(
this
.
debugService
.
getModel
());
const
addWatchExpressionAction
=
this
.
instantiationService
.
createInstance
(
AddWatchExpressionAction
,
AddWatchExpressionAction
.
ID
,
AddWatchExpressionAction
.
LABEL
);
const
collapseAction
=
this
.
instantiationService
.
createInstance
(
CollapseAction
,
this
.
tree
,
true
,
'
explorer-action collapse-explorer
'
);
const
removeAllWatchExpressionsAction
=
this
.
instantiationService
.
createInstance
(
RemoveAllWatchExpressionsAction
,
RemoveAllWatchExpressionsAction
.
ID
,
RemoveAllWatchExpressionsAction
.
LABEL
);
const
addWatchExpressionAction
=
new
AddWatchExpressionAction
(
AddWatchExpressionAction
.
ID
,
AddWatchExpressionAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
);
const
collapseAction
=
new
CollapseAction
(
this
.
tree
,
true
,
'
explorer-action collapse-explorer
'
);
const
removeAllWatchExpressionsAction
=
new
RemoveAllWatchExpressionsAction
(
RemoveAllWatchExpressionsAction
.
ID
,
RemoveAllWatchExpressionsAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
);
this
.
toolbar
.
setActions
(
prepareActions
([
addWatchExpressionAction
,
collapseAction
,
removeAllWatchExpressionsAction
]))();
this
.
disposables
.
push
(
this
.
debugService
.
getModel
().
onDidChangeWatchExpressions
(
we
=>
{
...
...
@@ -410,7 +410,7 @@ export class BreakpointsView extends ViewsViewletPanel {
public
renderBody
(
container
:
HTMLElement
):
void
{
dom
.
addClass
(
container
,
'
debug-breakpoints
'
);
this
.
treeContainer
=
renderViewTree
(
container
);
const
actionProvider
=
new
viewer
.
BreakpointsActionProvider
(
this
.
instantiationService
,
this
.
debugService
);
const
actionProvider
=
new
viewer
.
BreakpointsActionProvider
(
this
.
debugService
,
this
.
keybindingService
,
);
const
controller
=
this
.
instantiationService
.
createInstance
(
viewer
.
BreakpointsController
,
actionProvider
,
MenuId
.
DebugBreakpointsContext
);
this
.
tree
=
new
Tree
(
this
.
treeContainer
,
{
...
...
@@ -485,9 +485,9 @@ export class BreakpointsView extends ViewsViewletPanel {
public
getActions
():
IAction
[]
{
return
[
this
.
instantiationService
.
createInstance
(
AddFunctionBreakpointAction
,
AddFunctionBreakpointAction
.
ID
,
AddFunctionBreakpointAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
ToggleBreakpointsActivatedAction
,
ToggleBreakpointsActivatedAction
.
ID
,
ToggleBreakpointsActivatedAction
.
ACTIVATE_LABEL
),
this
.
instantiationService
.
createInstance
(
RemoveAllBreakpointsAction
,
RemoveAllBreakpointsAction
.
ID
,
RemoveAllBreakpointsAction
.
LABEL
)
new
AddFunctionBreakpointAction
(
AddFunctionBreakpointAction
.
ID
,
AddFunctionBreakpointAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
),
new
ToggleBreakpointsActivatedAction
(
ToggleBreakpointsActivatedAction
.
ID
,
ToggleBreakpointsActivatedAction
.
ACTIVATE_LABEL
,
this
.
debugService
,
this
.
keybindingService
),
new
RemoveAllBreakpointsAction
(
RemoveAllBreakpointsAction
.
ID
,
RemoveAllBreakpointsAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
)
];
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录