Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
94fdde32
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,发现更多精彩内容 >>
提交
94fdde32
编写于
11月 29, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support context menu action contributions for debug viewlet views
fixes #15657
上级
1dbc2f89
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
38 addition
and
9 deletion
+38
-9
src/vs/platform/actions/browser/menusExtensionPoint.ts
src/vs/platform/actions/browser/menusExtensionPoint.ts
+1
-0
src/vs/platform/actions/common/actions.ts
src/vs/platform/actions/common/actions.ts
+6
-1
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
+22
-2
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
+5
-4
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
+4
-2
未找到文件。
src/vs/platform/actions/browser/menusExtensionPoint.ts
浏览文件 @
94fdde32
...
...
@@ -32,6 +32,7 @@ namespace schema {
case
'
editor/context
'
:
return
MenuId
.
EditorContext
;
case
'
explorer/context
'
:
return
MenuId
.
ExplorerContext
;
case
'
editor/title/context
'
:
return
MenuId
.
EditorTitleContext
;
case
'
debug/callstack/context
'
:
return
MenuId
.
DebugCallStackContext
;
}
}
...
...
src/vs/platform/actions/common/actions.ts
浏览文件 @
94fdde32
...
...
@@ -39,7 +39,12 @@ export enum MenuId {
EditorTitleContext
=
2
,
EditorContext
=
3
,
ExplorerContext
=
4
,
ProblemsPanelContext
=
5
ProblemsPanelContext
=
5
,
DebugVariablesContext
=
6
,
DebugWatchContext
=
7
,
DebugCallStackContext
=
8
,
DebugBreakpointsContext
=
9
,
DebugConsoleContext
=
10
}
export
const
IMenuService
=
createDecorator
<
IMenuService
>
(
'
menuService
'
);
...
...
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
浏览文件 @
94fdde32
...
...
@@ -26,6 +26,8 @@ import { IContextViewService, IContextMenuService } from 'vs/platform/contextvie
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
{
IMenuService
,
IMenu
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
fillInActions
}
from
'
vs/platform/actions/browser/menuItemActionItem
'
;
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
'
;
...
...
@@ -177,14 +179,19 @@ function getSourceName(source: Source, contextService: IWorkspaceContextService)
export
class
BaseDebugController
extends
DefaultController
{
private
contributedContextMenu
:
IMenu
;
constructor
(
private
actionProvider
:
IActionProvider
,
menuId
:
MenuId
,
@
debug
.
IDebugService
protected
debugService
:
debug
.
IDebugService
,
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IMenuService
menuService
:
IMenuService
)
{
super
();
this
.
contributedContextMenu
=
menuService
.
createMenu
(
menuId
,
contextKeyService
);
if
(
isMacintosh
)
{
this
.
downKeyBindingDispatcher
.
set
(
KeyMod
.
CtrlCmd
|
KeyCode
.
Backspace
,
this
.
onDelete
.
bind
(
this
));
}
else
{
...
...
@@ -212,7 +219,10 @@ export class BaseDebugController extends DefaultController {
const
anchor
=
{
x
:
event
.
posx
+
1
,
y
:
event
.
posy
};
this
.
contextMenuService
.
showContextMenu
({
getAnchor
:
()
=>
anchor
,
getActions
:
()
=>
this
.
actionProvider
.
getSecondaryActions
(
tree
,
element
),
getActions
:
()
=>
this
.
actionProvider
.
getSecondaryActions
(
tree
,
element
).
then
(
actions
=>
{
fillInActions
(
this
.
contributedContextMenu
,
this
.
getContext
(
element
),
actions
);
return
actions
;
}),
onHide
:
(
wasCancelled
?:
boolean
)
=>
{
if
(
wasCancelled
)
{
tree
.
DOMFocus
();
...
...
@@ -234,6 +244,10 @@ export class BaseDebugController extends DefaultController {
protected
onRename
(
tree
:
ITree
,
event
:
IKeyboardEvent
):
boolean
{
return
false
;
}
protected
getContext
(
element
:
any
):
any
{
return
undefined
;
}
}
// call stack
...
...
@@ -295,6 +309,12 @@ export class CallStackController extends BaseDebugController {
return
true
;
}
protected
getContext
(
element
:
any
):
any
{
if
(
element
instanceof
StackFrame
)
{
return
element
.
source
.
uri
.
toString
();
}
}
// user clicked / pressed on 'Load More Stack Frames', get those stack frames and refresh the tree.
private
showMoreStackFrames
(
tree
:
ITree
,
threadAndProcessIds
:
ThreadAndProcessIds
):
boolean
{
const
process
=
this
.
debugService
.
getModel
().
getProcesses
().
filter
(
p
=>
p
.
getId
()
===
threadAndProcessIds
.
processId
).
pop
();
...
...
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
浏览文件 @
94fdde32
...
...
@@ -23,6 +23,7 @@ import * as viewer from 'vs/workbench/parts/debug/electron-browser/debugViewer';
import
{
AddWatchExpressionAction
,
RemoveAllWatchExpressionsAction
,
AddFunctionBreakpointAction
,
ToggleBreakpointsActivatedAction
,
RemoveAllBreakpointsAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
...
...
@@ -86,7 +87,7 @@ export class VariablesView extends CollapsibleViewletView {
dataSource
:
new
viewer
.
VariablesDataSource
(),
renderer
:
this
.
instantiationService
.
createInstance
(
viewer
.
VariablesRenderer
),
accessibilityProvider
:
new
viewer
.
VariablesAccessibilityProvider
(),
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
VariablesController
,
new
viewer
.
VariablesActionProvider
(
this
.
instantiationService
))
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
VariablesController
,
new
viewer
.
VariablesActionProvider
(
this
.
instantiationService
)
,
MenuId
.
DebugVariablesContext
)
},
{
ariaLabel
:
nls
.
localize
(
'
variablesAriaTreeLabel
'
,
"
Debug Variables
"
),
twistiePixels
...
...
@@ -182,7 +183,7 @@ export class WatchExpressionsView extends CollapsibleViewletView {
dataSource
:
new
viewer
.
WatchExpressionsDataSource
(),
renderer
:
this
.
instantiationService
.
createInstance
(
viewer
.
WatchExpressionsRenderer
,
actionProvider
,
this
.
actionRunner
),
accessibilityProvider
:
new
viewer
.
WatchExpressionsAccessibilityProvider
(),
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
WatchExpressionsController
,
actionProvider
),
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
WatchExpressionsController
,
actionProvider
,
MenuId
.
DebugWatchContext
),
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 +302,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
:
this
.
instantiationService
.
createInstance
(
viewer
.
CallStackController
,
actionProvider
)
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
CallStackController
,
actionProvider
,
MenuId
.
DebugCallStackContext
)
},
{
ariaLabel
:
nls
.
localize
({
comment
:
[
'
Debug is a noun in this context, not a verb.
'
],
key
:
'
callStackAriaLabel
'
},
"
Debug Call Stack
"
),
twistiePixels
...
...
@@ -361,7 +362,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
:
this
.
instantiationService
.
createInstance
(
viewer
.
BreakpointsController
,
actionProvider
),
controller
:
this
.
instantiationService
.
createInstance
(
viewer
.
BreakpointsController
,
actionProvider
,
MenuId
.
DebugBreakpointsContext
),
sorter
:
{
compare
(
tree
:
ITree
,
element
:
any
,
otherElement
:
any
):
number
{
const
first
=
<
IBreakpoint
>
element
;
...
...
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
浏览文件 @
94fdde32
...
...
@@ -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
{
MenuId
,
IMenuService
}
from
'
vs/platform/actions/common/actions
'
;
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
'
;
...
...
@@ -501,9 +502,10 @@ export class ReplExpressionsController extends BaseDebugController {
actionProvider
:
IActionProvider
,
@
IDebugService
debugService
:
IDebugService
,
@
IContextMenuService
contextMenuService
:
IContextMenuService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IMenuService
menuService
:
IMenuService
)
{
super
(
actionProvider
,
debugService
,
contextMenuService
,
contextKey
Service
);
super
(
actionProvider
,
MenuId
.
DebugConsoleContext
,
debugService
,
contextMenuService
,
contextKeyService
,
menu
Service
);
}
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录