Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f31a1f4b
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,发现更多精彩内容 >>
提交
f31a1f4b
编写于
4月 19, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug api polish: comments and remove toggleEnablement
上级
74e689f5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
76 addition
and
39 deletion
+76
-39
src/vs/workbench/parts/debug/browser/debugViewer.ts
src/vs/workbench/parts/debug/browser/debugViewer.ts
+2
-2
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+50
-6
src/vs/workbench/parts/debug/common/debugModel.ts
src/vs/workbench/parts/debug/common/debugModel.ts
+7
-7
src/vs/workbench/parts/debug/electron-browser/debugActions.ts
...vs/workbench/parts/debug/electron-browser/debugActions.ts
+3
-3
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+11
-12
src/vs/workbench/parts/debug/test/common/debugModel.test.ts
src/vs/workbench/parts/debug/test/common/debugModel.test.ts
+1
-1
src/vs/workbench/parts/debug/test/common/mockDebugService.ts
src/vs/workbench/parts/debug/test/common/mockDebugService.ts
+2
-8
未找到文件。
src/vs/workbench/parts/debug/browser/debugViewer.ts
浏览文件 @
f31a1f4b
...
...
@@ -905,7 +905,7 @@ export class BreakpointsRenderer implements tree.IRenderer {
public
renderElement
(
tree
:
tree
.
ITree
,
element
:
any
,
templateId
:
string
,
templateData
:
any
):
void
{
templateData
.
toDisposeBeforeRender
=
lifecycle
.
dispose
(
templateData
.
toDisposeBeforeRender
);
templateData
.
toDisposeBeforeRender
.
push
(
dom
.
addStandardDisposableListener
(
templateData
.
checkbox
,
'
change
'
,
(
e
)
=>
{
this
.
debugService
.
toggleEnablement
(
element
);
this
.
debugService
.
enableOrDisableBreakpoints
(
!
element
.
enabled
,
element
);
}));
if
(
templateId
===
BreakpointsRenderer
.
EXCEPTION_BREAKPOINT_TEMPLATE_ID
)
{
...
...
@@ -989,7 +989,7 @@ export class BreakpointsController extends BaseDebugController {
protected
onSpace
(
tree
:
tree
.
ITree
,
event
:
IKeyboardEvent
):
boolean
{
super
.
onSpace
(
tree
,
event
);
const
element
=
<
debug
.
IEnablement
>
tree
.
getFocus
();
this
.
debugService
.
toggleEnablement
(
element
).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
debugService
.
enableOrDisableBreakpoints
(
!
element
.
enabled
,
element
).
done
(
null
,
errors
.
onUnexpectedError
);
return
true
;
}
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
f31a1f4b
...
...
@@ -302,34 +302,78 @@ export interface IDebugService {
setFocusedStackFrameAndEvaluate
(
focusedStackFrame
:
IStackFrame
):
TPromise
<
void
>
;
/**
*
General breakpoints manipulation
.
*
Adds new breakpoints to the model. Notifies debug adapter of breakpoint changes
.
*/
addBreakpoints
(
rawBreakpoints
:
IRawBreakpoint
[]):
TPromise
<
void
[]
>
;
enableOrDisableAllBreakpoints
(
enabled
:
boolean
):
TPromise
<
void
>
;
toggleEnablement
(
element
:
IEnablement
):
TPromise
<
void
>
;
/**
* Enables or disables all breakpoints. If breakpoint is passed only enables or disables the passed breakpoint.
* Notifies debug adapter of breakpoint changes.
*/
enableOrDisableBreakpoints
(
enable
:
boolean
,
breakpoint
?:
IEnablement
):
TPromise
<
void
>
;
/**
* Sets the global activated property for all breakpoints.
* Notifies debug adapter of breakpoint changes.
*/
setBreakpointsActivated
(
activated
:
boolean
):
TPromise
<
void
>
;
/**
* Removes all breakpoints. If id is passed only removes the breakpoint associated with that id.
* Notifies debug adapter of breakpoint changes.
*/
removeBreakpoints
(
id
?:
string
):
TPromise
<
any
>
;
/**
*
Function breakpoints manipulation
.
*
Adds a new no name function breakpoint. The function breakpoint should be renamed once user enters the name
.
*/
addFunctionBreakpoint
():
void
;
/**
* Renames an already existing function breakpoint.
* Notifies debug adapter of breakpoint changes.
*/
renameFunctionBreakpoint
(
id
:
string
,
newFunctionName
:
string
):
TPromise
<
void
>
;
/**
* Removes all function breakpoints. If id is passed only removes the function breakpoint with the passed id.
* Notifies debug adapter of breakpoint changes.
*/
removeFunctionBreakpoints
(
id
?:
string
):
TPromise
<
void
>
;
/**
*
Repl expressions manipulation
.
*
Adds a new expression to the repl
.
*/
addReplExpression
(
name
:
string
):
TPromise
<
void
>
;
/**
* Removes all repl expressions.
*/
removeReplExpressions
():
void
;
/**
* Adds a new log to the repl. Either a string value or a dictionary (used to inspect complex objects printed to the repl).
*/
logToRepl
(
value
:
string
|
{
[
key
:
string
]:
any
},
severity
?:
severity
):
void
;
/**
* Appends new output to the repl.
*/
appendReplOutput
(
value
:
string
,
severity
?:
severity
):
void
;
/**
*
Watch expressions manipulation
.
*
Adds a new watch expression and evaluates it against the debug adapter
.
*/
addWatchExpression
(
name
?:
string
):
TPromise
<
void
>
;
/**
* Renames a watch expression and evaluates it against the debug adapter.
*/
renameWatchExpression
(
id
:
string
,
newName
:
string
):
TPromise
<
void
>
;
/**
* Removes all watch expressions. If id is passed only removes the watch expression with the passed id.
*/
removeWatchExpressions
(
id
?:
string
):
void
;
/**
...
...
src/vs/workbench/parts/debug/common/debugModel.ts
浏览文件 @
f31a1f4b
...
...
@@ -517,8 +517,8 @@ export class Model implements debug.IModel {
this
.
_onDidChangeBreakpoints
.
fire
();
}
public
toggleEnablement
(
element
:
debug
.
IEnablement
):
void
{
element
.
enabled
=
!
element
.
enabled
;
public
setEnablement
(
element
:
debug
.
IEnablement
,
enable
:
boolean
):
void
{
element
.
enabled
=
enable
;
if
(
element
instanceof
Breakpoint
&&
!
element
.
enabled
)
{
var
breakpoint
=
<
Breakpoint
>
element
;
breakpoint
.
lineNumber
=
breakpoint
.
desiredLineNumber
;
...
...
@@ -528,16 +528,16 @@ export class Model implements debug.IModel {
this
.
_onDidChangeBreakpoints
.
fire
();
}
public
enableOrDisableAllBreakpoints
(
enable
d
:
boolean
):
void
{
public
enableOrDisableAllBreakpoints
(
enable
:
boolean
):
void
{
this
.
breakpoints
.
forEach
(
bp
=>
{
bp
.
enabled
=
enable
d
;
if
(
!
enable
d
)
{
bp
.
enabled
=
enable
;
if
(
!
enable
)
{
bp
.
lineNumber
=
bp
.
desiredLineNumber
;
bp
.
verified
=
false
;
}
});
this
.
exceptionBreakpoints
.
forEach
(
ebp
=>
ebp
.
enabled
=
enable
d
);
this
.
functionBreakpoints
.
forEach
(
fbp
=>
fbp
.
enabled
=
enable
d
);
this
.
exceptionBreakpoints
.
forEach
(
ebp
=>
ebp
.
enabled
=
enable
);
this
.
functionBreakpoints
.
forEach
(
fbp
=>
fbp
.
enabled
=
enable
);
this
.
_onDidChangeBreakpoints
.
fire
();
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugActions.ts
浏览文件 @
f31a1f4b
...
...
@@ -303,7 +303,7 @@ export class ToggleEnablementAction extends AbstractDebugAction {
}
public
run
(
element
:
debug
.
IEnablement
):
TPromise
<
any
>
{
return
this
.
debugService
.
toggleEnablement
(
element
);
return
this
.
debugService
.
enableOrDisableBreakpoints
(
!
element
.
enabled
,
element
);
}
}
...
...
@@ -317,7 +317,7 @@ export class EnableAllBreakpointsAction extends AbstractDebugAction {
}
public
run
():
TPromise
<
any
>
{
return
this
.
debugService
.
enableOrDisable
All
Breakpoints
(
true
);
return
this
.
debugService
.
enableOrDisableBreakpoints
(
true
);
}
protected
isEnabled
(
state
:
debug
.
State
):
boolean
{
...
...
@@ -336,7 +336,7 @@ export class DisableAllBreakpointsAction extends AbstractDebugAction {
}
public
run
():
TPromise
<
any
>
{
return
this
.
debugService
.
enableOrDisable
All
Breakpoints
(
false
);
return
this
.
debugService
.
enableOrDisableBreakpoints
(
false
);
}
protected
isEnabled
(
state
:
debug
.
State
):
boolean
{
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
f31a1f4b
...
...
@@ -426,21 +426,20 @@ export class DebugService implements debug.IDebugService {
}
}
public
enableOrDisableAllBreakpoints
(
enabled
:
boolean
):
TPromise
<
void
>
{
this
.
model
.
enableOrDisableAllBreakpoints
(
enabled
);
return
this
.
sendAllBreakpoints
();
}
public
enableOrDisableBreakpoints
(
enable
:
boolean
,
breakpoint
?:
debug
.
IEnablement
):
TPromise
<
void
>
{
if
(
breakpoint
)
{
this
.
model
.
setEnablement
(
breakpoint
,
enable
);
if
(
breakpoint
instanceof
model
.
Breakpoint
)
{
return
this
.
sendBreakpoints
((
<
model
.
Breakpoint
>
breakpoint
).
source
.
uri
);
}
else
if
(
breakpoint
instanceof
model
.
FunctionBreakpoint
)
{
return
this
.
sendFunctionBreakpoints
();
}
public
toggleEnablement
(
element
:
debug
.
IEnablement
):
TPromise
<
void
>
{
this
.
model
.
toggleEnablement
(
element
);
if
(
element
instanceof
model
.
Breakpoint
)
{
const
breakpoint
=
<
model
.
Breakpoint
>
element
;
return
this
.
sendBreakpoints
(
breakpoint
.
source
.
uri
);
}
else
if
(
element
instanceof
model
.
FunctionBreakpoint
)
{
return
this
.
sendFunctionBreakpoints
();
return
this
.
sendExceptionBreakpoints
();
}
return
this
.
sendExceptionBreakpoints
();
this
.
model
.
enableOrDisableAllBreakpoints
(
enable
);
return
this
.
sendAllBreakpoints
();
}
public
addBreakpoints
(
rawBreakpoints
:
debug
.
IRawBreakpoint
[]):
TPromise
<
void
[]
>
{
...
...
src/vs/workbench/parts/debug/test/common/debugModel.test.ts
浏览文件 @
f31a1f4b
...
...
@@ -69,7 +69,7 @@ suite('Debug - Model', () => {
model
.
getBreakpoints
().
forEach
(
bp
=>
{
assert
.
equal
(
bp
.
enabled
,
false
);
});
model
.
toggleEnablement
(
bp
);
model
.
setEnablement
(
bp
,
true
);
assert
.
equal
(
bp
.
enabled
,
true
);
model
.
removeBreakpoints
(
model
.
getBreakpoints
().
filter
(
bp
=>
bp
.
source
.
uri
.
toString
()
===
modelUri1
.
toString
()));
...
...
src/vs/workbench/parts/debug/test/common/mockDebugService.ts
浏览文件 @
f31a1f4b
...
...
@@ -41,11 +41,7 @@ export class MockDebugService implements debug.IDebugService {
return
TPromise
.
as
(
null
);
}
public
enableOrDisableAllBreakpoints
(
enabled
:
boolean
):
TPromise
<
void
>
{
return
TPromise
.
as
(
null
);
}
public
toggleEnablement
(
element
:
debug
.
IEnablement
):
TPromise
<
void
>
{
public
enableOrDisableBreakpoints
(
enabled
:
boolean
):
TPromise
<
void
>
{
return
TPromise
.
as
(
null
);
}
...
...
@@ -73,9 +69,7 @@ export class MockDebugService implements debug.IDebugService {
public
removeReplExpressions
():
void
{}
public
logToRepl
(
value
:
string
,
severity
?:
severity
):
void
;
public
logToRepl
(
value
:
{
[
key
:
string
]:
any
},
severity
?:
severity
):
void
;
public
logToRepl
(
value
:
any
,
severity
?:
severity
):
void
{}
public
logToRepl
(
value
:
string
|
{
[
key
:
string
]:
any
},
severity
?:
severity
):
void
{}
public
appendReplOutput
(
value
:
string
,
severity
?:
severity
):
void
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录