Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e4847a2c
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e4847a2c
编写于
11月 01, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: drag n drop watch expressions
fixes #14125
上级
5b176fb8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
60 addition
and
3 deletion
+60
-3
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+5
-0
src/vs/workbench/parts/debug/common/debugModel.ts
src/vs/workbench/parts/debug/common/debugModel.ts
+8
-0
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+4
-0
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
+40
-3
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
+1
-0
src/vs/workbench/parts/debug/test/common/mockDebug.ts
src/vs/workbench/parts/debug/test/common/mockDebug.ts
+2
-0
未找到文件。
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
e4847a2c
...
...
@@ -443,6 +443,11 @@ export interface IDebugService {
*/
renameWatchExpression
(
id
:
string
,
newName
:
string
):
TPromise
<
void
>
;
/**
* Moves a watch expression to a new possition. Used for reordering watch expressions.
*/
moveWatchExpression
(
id
:
string
,
position
:
number
):
void
;
/**
* Removes all watch expressions. If id is passed only removes the watch expression with the passed id.
*/
...
...
src/vs/workbench/parts/debug/common/debugModel.ts
浏览文件 @
e4847a2c
...
...
@@ -936,6 +936,14 @@ export class Model implements debug.IModel {
this
.
_onDidChangeWatchExpressions
.
fire
();
}
public
moveWatchExpression
(
id
:
string
,
position
:
number
):
void
{
const
we
=
this
.
watchExpressions
.
filter
(
we
=>
we
.
getId
()
===
id
).
pop
();
this
.
watchExpressions
=
this
.
watchExpressions
.
filter
(
we
=>
we
.
getId
()
!==
id
);
this
.
watchExpressions
=
this
.
watchExpressions
.
slice
(
0
,
position
).
concat
(
we
,
this
.
watchExpressions
.
slice
(
position
));
this
.
_onDidChangeWatchExpressions
.
fire
();
}
public
sourceIsUnavailable
(
source
:
Source
):
void
{
this
.
processes
.
forEach
(
p
=>
p
.
sourceIsUnavailable
(
source
));
this
.
_onDidChangeCallStack
.
fire
();
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
e4847a2c
...
...
@@ -534,6 +534,10 @@ export class DebugService implements debug.IDebugService {
return
this
.
model
.
renameWatchExpression
(
this
.
viewModel
.
focusedProcess
,
this
.
viewModel
.
focusedStackFrame
,
id
,
newName
);
}
public
moveWatchExpression
(
id
:
string
,
position
:
number
):
void
{
this
.
model
.
moveWatchExpression
(
id
,
position
);
}
public
removeWatchExpressions
(
id
?:
string
):
void
{
this
.
model
.
removeWatchExpressions
(
id
);
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
浏览文件 @
e4847a2c
...
...
@@ -13,13 +13,13 @@ import * as errors from 'vs/base/common/errors';
import
{
equalsIgnoreCase
}
from
'
vs/base/common/strings
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
IMouseEvent
,
DragMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
getPathLabel
}
from
'
vs/base/common/labels
'
;
import
{
IAction
,
IActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
IActionItem
,
Separator
,
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ITree
,
IAccessibilityProvider
,
ContextMenuEvent
,
IDataSource
,
IRenderer
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
ITree
,
IAccessibilityProvider
,
ContextMenuEvent
,
IDataSource
,
IRenderer
,
DRAG_OVER_ACCEPT
,
IDragAndDropData
,
IDragOverReaction
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
InputBox
,
IInputValidationOptions
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
DefaultController
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
DefaultController
,
DefaultDragAndDrop
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
IActionProvider
}
from
'
vs/base/parts/tree/browser/actionsRenderer
'
;
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
'
;
...
...
@@ -991,6 +991,43 @@ export class WatchExpressionsController extends BaseDebugController {
}
}
export
class
WatchExpressionsDragAndDrop
extends
DefaultDragAndDrop
{
constructor
(
@
debug
.
IDebugService
private
debugService
:
debug
.
IDebugService
)
{
super
();
}
public
getDragURI
(
tree
:
ITree
,
element
:
Expression
):
string
{
if
(
!
(
element
instanceof
Expression
))
{
return
null
;
}
return
element
.
getId
();
}
public
getDragLabel
(
tree
:
ITree
,
elements
:
Expression
[]):
string
{
if
(
elements
.
length
>
1
)
{
return
String
(
elements
.
length
);
}
return
elements
[
0
].
name
;
}
public
onDragOver
(
tree
:
ITree
,
data
:
IDragAndDropData
,
target
:
Expression
|
Model
,
originalEvent
:
DragMouseEvent
):
IDragOverReaction
{
return
DRAG_OVER_ACCEPT
;
}
public
drop
(
tree
:
ITree
,
data
:
IDragAndDropData
,
target
:
Expression
|
Model
,
originalEvent
:
DragMouseEvent
):
void
{
const
draggedData
=
data
.
getData
();
if
(
Array
.
isArray
(
draggedData
))
{
const
draggedElement
=
<
Expression
>
draggedData
[
0
];
const
watches
=
this
.
debugService
.
getModel
().
getWatchExpressions
();
const
position
=
target
instanceof
Model
?
watches
.
length
-
1
:
watches
.
indexOf
(
target
);
this
.
debugService
.
moveWatchExpression
(
draggedElement
.
getId
(),
position
);
}
}
}
// breakpoints
export
class
BreakpointsActionProvider
implements
IActionProvider
{
...
...
src/vs/workbench/parts/debug/electron-browser/debugViews.ts
浏览文件 @
e4847a2c
...
...
@@ -197,6 +197,7 @@ export class WatchExpressionsView extends CollapsibleViewletView {
renderer
:
this
.
instantiationService
.
createInstance
(
viewer
.
WatchExpressionsRenderer
,
actionProvider
,
this
.
actionRunner
),
accessibilityProvider
:
new
viewer
.
WatchExpressionsAccessibilityProvider
(),
controller
:
new
viewer
.
WatchExpressionsController
(
this
.
debugService
,
this
.
contextMenuService
,
actionProvider
),
dnd
:
this
.
instantiationService
.
createInstance
(
viewer
.
WatchExpressionsDragAndDrop
)
},
debugTreeOptions
(
nls
.
localize
({
comment
:
[
'
Debug is a noun in this context, not a verb.
'
],
key
:
'
watchAriaTreeLabel
'
},
"
Debug Watch Expressions
"
)));
this
.
tree
.
setInput
(
this
.
debugService
.
getModel
());
...
...
src/vs/workbench/parts/debug/test/common/mockDebug.ts
浏览文件 @
e4847a2c
...
...
@@ -47,6 +47,8 @@ export class MockDebugService implements debug.IDebugService {
public
addFunctionBreakpoint
():
void
{
}
public
moveWatchExpression
(
id
:
string
,
position
:
number
):
void
{
}
public
renameFunctionBreakpoint
(
id
:
string
,
newFunctionName
:
string
):
TPromise
<
void
>
{
return
TPromise
.
as
(
null
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录