Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
15d8874e
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,体验更适合开发者的 AI 搜索 >>
提交
15d8874e
编写于
2月 06, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: refactor updating of breakpoints
fixes #42200
上级
bc7b804f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
40 addition
and
26 deletion
+40
-26
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
.../workbench/api/electron-browser/mainThreadDebugService.ts
+2
-2
src/vs/workbench/parts/debug/browser/breakpointWidget.ts
src/vs/workbench/parts/debug/browser/breakpointWidget.ts
+22
-15
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+8
-3
src/vs/workbench/parts/debug/common/debugModel.ts
src/vs/workbench/parts/debug/common/debugModel.ts
+5
-3
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+1
-1
src/vs/workbench/parts/debug/test/common/mockDebug.ts
src/vs/workbench/parts/debug/test/common/mockDebug.ts
+2
-2
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
浏览文件 @
15d8874e
...
...
@@ -6,7 +6,7 @@
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
uri
from
'
vs/base/common/uri
'
;
import
{
IDebugService
,
IConfig
,
IDebugConfigurationProvider
,
IBreakpoint
,
IFunctionBreakpoint
,
I
RawBreakpoint
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IDebugService
,
IConfig
,
IDebugConfigurationProvider
,
IBreakpoint
,
IFunctionBreakpoint
,
I
BreakpointData
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
...
...
@@ -97,7 +97,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape {
for
(
let
dto
of
DTOs
)
{
if
(
dto
.
type
===
'
sourceMulti
'
)
{
const
rawbps
=
dto
.
lines
.
map
(
l
=>
<
I
RawBreakpoint
>
{
<
I
BreakpointData
>
{
id
:
l
.
id
,
enabled
:
l
.
enabled
,
lineNumber
:
l
.
line
+
1
,
...
...
src/vs/workbench/parts/debug/browser/breakpointWidget.ts
浏览文件 @
15d8874e
...
...
@@ -15,7 +15,7 @@ import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
ZoneWidget
}
from
'
vs/editor/contrib/zoneWidget/zoneWidget
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IDebugService
,
IBreakpoint
,
IRawBreakpoint
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IDebugService
,
IBreakpoint
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
once
}
from
'
vs/base/common/functional
'
;
import
{
attachInputBoxStyler
,
attachSelectBoxStyler
}
from
'
vs/platform/theme/common/styler
'
;
...
...
@@ -109,31 +109,38 @@ export class BreakpointWidget extends ZoneWidget {
const
oldBreakpoint
=
this
.
debugService
.
getModel
().
getBreakpoints
()
.
filter
(
bp
=>
bp
.
lineNumber
===
this
.
lineNumber
&&
bp
.
column
===
this
.
column
&&
bp
.
uri
.
toString
()
===
uri
.
toString
()).
pop
();
const
raw
:
IRawBreakpoint
=
{
lineNumber
:
this
.
lineNumber
,
column
:
oldBreakpoint
?
oldBreakpoint
.
column
:
undefined
,
enabled
:
true
,
condition
:
oldBreakpoint
&&
oldBreakpoint
.
condition
,
hitCondition
:
oldBreakpoint
&&
oldBreakpoint
.
hitCondition
};
let
condition
=
oldBreakpoint
&&
oldBreakpoint
.
condition
;
let
hitCondition
=
oldBreakpoint
&&
oldBreakpoint
.
hitCondition
;
if
(
this
.
hitCountContext
)
{
raw
.
hitCondition
=
this
.
inputBox
.
value
;
hitCondition
=
this
.
inputBox
.
value
;
if
(
this
.
conditionInput
)
{
raw
.
condition
=
this
.
conditionInput
;
condition
=
this
.
conditionInput
;
}
}
else
{
raw
.
condition
=
this
.
inputBox
.
value
;
condition
=
this
.
inputBox
.
value
;
if
(
this
.
hitCountInput
)
{
raw
.
hitCondition
=
this
.
hitCountInput
;
hitCondition
=
this
.
hitCountInput
;
}
}
if
(
oldBreakpoint
)
{
this
.
debugService
.
removeBreakpoints
(
oldBreakpoint
.
getId
()).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
debugService
.
updateBreakpoints
(
oldBreakpoint
.
uri
,
{
[
oldBreakpoint
.
getId
()]:
{
condition
,
hitCondition
,
verified
:
oldBreakpoint
.
verified
}
});
}
else
{
this
.
debugService
.
addBreakpoints
(
uri
,
[{
lineNumber
:
this
.
lineNumber
,
column
:
oldBreakpoint
?
oldBreakpoint
.
column
:
undefined
,
enabled
:
true
,
condition
,
hitCondition
}]).
done
(
null
,
errors
.
onUnexpectedError
);
}
this
.
debugService
.
addBreakpoints
(
uri
,
[
raw
]).
done
(
null
,
errors
.
onUnexpectedError
);
}
this
.
dispose
();
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
15d8874e
...
...
@@ -222,7 +222,7 @@ export interface IEnablement extends ITreeElement {
enabled
:
boolean
;
}
export
interface
I
RawBreakpoint
{
export
interface
I
BreakpointData
{
id
?:
string
;
lineNumber
:
number
;
column
?:
number
;
...
...
@@ -231,6 +231,11 @@ export interface IRawBreakpoint {
hitCondition
?:
string
;
}
export
interface
IBreakpointUpdateData
extends
DebugProtocol
.
Breakpoint
{
condition
?:
string
;
hitCondition
?:
string
;
}
export
interface
IBreakpoint
extends
IEnablement
{
uri
:
uri
;
lineNumber
:
number
;
...
...
@@ -536,12 +541,12 @@ export interface IDebugService {
/**
* Adds new breakpoints to the model for the file specified with the uri. Notifies debug adapter of breakpoint changes.
*/
addBreakpoints
(
uri
:
uri
,
rawBreakpoints
:
I
RawBreakpoint
[]):
TPromise
<
void
>
;
addBreakpoints
(
uri
:
uri
,
rawBreakpoints
:
I
BreakpointData
[]):
TPromise
<
void
>
;
/**
* Updates the breakpoints.
*/
updateBreakpoints
(
uri
:
uri
,
data
:
{
[
id
:
string
]:
DebugProtocol
.
Breakpoint
}):
void
;
updateBreakpoints
(
uri
:
uri
,
data
:
{
[
id
:
string
]:
IBreakpointUpdateData
}):
void
;
/**
* Enables or disables all breakpoints. If breakpoint is passed only enables or disables the passed breakpoint.
...
...
src/vs/workbench/parts/debug/common/debugModel.ts
浏览文件 @
15d8874e
...
...
@@ -20,7 +20,7 @@ import { ISuggestion } from 'vs/editor/common/modes';
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
ITreeElement
,
IExpression
,
IExpressionContainer
,
IProcess
,
IStackFrame
,
IExceptionBreakpoint
,
IBreakpoint
,
IFunctionBreakpoint
,
IModel
,
IReplElementSource
,
IConfig
,
ISession
,
IThread
,
IRawModelUpdate
,
IScope
,
IRawStoppedDetails
,
IEnablement
,
I
RawBreakpoint
,
IExceptionInfo
,
IReplElement
,
ProcessState
,
IBreakpointsChangeEvent
IConfig
,
ISession
,
IThread
,
IRawModelUpdate
,
IScope
,
IRawStoppedDetails
,
IEnablement
,
I
BreakpointData
,
IExceptionInfo
,
IReplElement
,
ProcessState
,
IBreakpointsChangeEvent
,
IBreakpointUpdateData
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
Source
}
from
'
vs/workbench/parts/debug/common/debugSource
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
...
...
@@ -864,7 +864,7 @@ export class Model implements IModel {
this
.
_onDidChangeBreakpoints
.
fire
();
}
public
addBreakpoints
(
uri
:
uri
,
rawData
:
I
RawBreakpoint
[],
fireEvent
=
true
):
Breakpoint
[]
{
public
addBreakpoints
(
uri
:
uri
,
rawData
:
I
BreakpointData
[],
fireEvent
=
true
):
Breakpoint
[]
{
const
newBreakpoints
=
rawData
.
map
(
rawBp
=>
new
Breakpoint
(
uri
,
rawBp
.
lineNumber
,
rawBp
.
column
,
rawBp
.
enabled
,
rawBp
.
condition
,
rawBp
.
hitCondition
,
undefined
,
rawBp
.
id
));
this
.
breakpoints
=
this
.
breakpoints
.
concat
(
newBreakpoints
);
this
.
breakpointsActivated
=
true
;
...
...
@@ -882,7 +882,7 @@ export class Model implements IModel {
this
.
_onDidChangeBreakpoints
.
fire
({
removed
:
toRemove
});
}
public
updateBreakpoints
(
data
:
{
[
id
:
string
]:
DebugProtocol
.
Breakpoint
}):
void
{
public
updateBreakpoints
(
data
:
{
[
id
:
string
]:
IBreakpointUpdateData
}):
void
{
const
updated
:
IBreakpoint
[]
=
[];
this
.
breakpoints
.
forEach
(
bp
=>
{
const
bpData
=
data
[
bp
.
getId
()];
...
...
@@ -895,6 +895,8 @@ export class Model implements IModel {
bp
.
idFromAdapter
=
bpData
.
id
;
bp
.
message
=
bpData
.
message
;
bp
.
adapterData
=
bpData
.
source
?
bpData
.
source
.
adapterData
:
bp
.
adapterData
;
bp
.
condition
=
bpData
.
condition
||
bp
.
condition
;
bp
.
hitCondition
=
bpData
.
hitCondition
||
bp
.
hitCondition
;
updated
.
push
(
bp
);
}
});
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
15d8874e
...
...
@@ -580,7 +580,7 @@ export class DebugService implements debug.IDebugService {
return
this
.
sendAllBreakpoints
();
}
public
addBreakpoints
(
uri
:
uri
,
rawBreakpoints
:
debug
.
I
RawBreakpoint
[]):
TPromise
<
void
>
{
public
addBreakpoints
(
uri
:
uri
,
rawBreakpoints
:
debug
.
I
BreakpointData
[]):
TPromise
<
void
>
{
this
.
model
.
addBreakpoints
(
uri
,
rawBreakpoints
);
rawBreakpoints
.
forEach
(
rbp
=>
aria
.
status
(
nls
.
localize
(
'
breakpointAdded
'
,
"
Added breakpoint, line {0}, file {1}
"
,
rbp
.
lineNumber
,
uri
.
fsPath
)));
...
...
src/vs/workbench/parts/debug/test/common/mockDebug.ts
浏览文件 @
15d8874e
...
...
@@ -39,11 +39,11 @@ export class MockDebugService implements debug.IDebugService {
public
focusStackFrame
(
focusedStackFrame
:
debug
.
IStackFrame
):
void
{
}
public
addBreakpoints
(
uri
:
uri
,
rawBreakpoints
:
debug
.
I
RawBreakpoint
[]):
TPromise
<
void
>
{
public
addBreakpoints
(
uri
:
uri
,
rawBreakpoints
:
debug
.
I
BreakpointData
[]):
TPromise
<
void
>
{
return
TPromise
.
as
(
null
);
}
public
updateBreakpoints
(
uri
:
uri
,
data
:
{
[
id
:
string
]:
DebugProtocol
.
Breakpoint
}):
void
{
}
public
updateBreakpoints
(
uri
:
uri
,
data
:
{
[
id
:
string
]:
debug
.
IBreakpointUpdateData
}):
void
{
}
public
enableOrDisableBreakpoints
(
enabled
:
boolean
):
TPromise
<
void
>
{
return
TPromise
.
as
(
null
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录