Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f9281d83
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,发现更多精彩内容 >>
提交
f9281d83
编写于
10月 09, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: simplify setting breakpoint session data
上级
9c9e3164
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
31 deletion
+19
-31
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+0
-1
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+2
-4
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+4
-12
src/vs/workbench/parts/debug/electron-browser/debugSession.ts
...vs/workbench/parts/debug/electron-browser/debugSession.ts
+10
-11
src/vs/workbench/parts/debug/test/common/mockDebug.ts
src/vs/workbench/parts/debug/test/common/mockDebug.ts
+3
-3
未找到文件。
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
f9281d83
...
...
@@ -196,7 +196,6 @@ export class SelectAndStartAction extends AbstractDebugAction {
@
IQuickOpenService
private
quickOpenService
:
IQuickOpenService
)
{
super
(
id
,
label
,
undefined
,
debugService
,
keybindingService
);
this
.
quickOpenService
=
quickOpenService
;
}
public
run
():
TPromise
<
any
>
{
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
f9281d83
...
...
@@ -116,8 +116,6 @@ export interface IDebugger {
getCustomTelemetryService
():
TPromise
<
TelemetryService
>
;
}
export
type
ActualBreakpoints
=
{
[
id
:
string
]:
DebugProtocol
.
Breakpoint
};
export
enum
State
{
Inactive
,
Initializing
,
...
...
@@ -186,8 +184,8 @@ export interface IDebugSession extends ITreeElement {
terminate
(
restart
?:
boolean
/* false */
):
TPromise
<
void
>
;
disconnect
(
restart
?:
boolean
/* false */
):
TPromise
<
void
>
;
sendBreakpoints
(
modelUri
:
uri
,
bpts
:
IBreakpoint
[],
sourceModified
:
boolean
):
TPromise
<
ActualBreakpoints
|
undefine
d
>
;
sendFunctionBreakpoints
(
fbps
:
IFunctionBreakpoint
[]):
TPromise
<
ActualBreakpoints
|
undefine
d
>
;
sendBreakpoints
(
modelUri
:
uri
,
bpts
:
IBreakpoint
[],
sourceModified
:
boolean
):
TPromise
<
voi
d
>
;
sendFunctionBreakpoints
(
fbps
:
IFunctionBreakpoint
[]):
TPromise
<
voi
d
>
;
sendExceptionBreakpoints
(
exbpts
:
IExceptionBreakpoint
[]):
TPromise
<
void
>
;
stackTrace
(
threadId
:
number
,
startFrame
:
number
,
levels
:
number
):
TPromise
<
DebugProtocol
.
StackTraceResponse
>
;
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
f9281d83
...
...
@@ -871,13 +871,9 @@ export class DebugService implements IDebugService {
const
breakpointsToSend
=
this
.
model
.
getBreakpoints
({
uri
:
modelUri
,
enabledOnly
:
true
});
return
this
.
sendToOneOrAllSessions
(
session
,
s
=>
{
return
s
.
sendBreakpoints
(
modelUri
,
breakpointsToSend
,
sourceModified
).
then
(
data
=>
{
if
(
data
)
{
this
.
model
.
setBreakpointSessionData
(
s
.
getId
(),
data
);
}
});
});
return
this
.
sendToOneOrAllSessions
(
session
,
s
=>
s
.
sendBreakpoints
(
modelUri
,
breakpointsToSend
,
sourceModified
)
);
}
private
sendFunctionBreakpoints
(
session
?:
IDebugSession
):
TPromise
<
void
>
{
...
...
@@ -885,11 +881,7 @@ export class DebugService implements IDebugService {
const
breakpointsToSend
=
this
.
model
.
getFunctionBreakpoints
().
filter
(
fbp
=>
fbp
.
enabled
&&
this
.
model
.
areBreakpointsActivated
());
return
this
.
sendToOneOrAllSessions
(
session
,
s
=>
{
return
s
.
capabilities
.
supportsFunctionBreakpoints
?
s
.
sendFunctionBreakpoints
(
breakpointsToSend
).
then
(
data
=>
{
if
(
data
)
{
this
.
model
.
setBreakpointSessionData
(
s
.
getId
(),
data
);
}
})
:
Promise
.
resolve
(
undefined
);
return
s
.
capabilities
.
supportsFunctionBreakpoints
?
s
.
sendFunctionBreakpoints
(
breakpointsToSend
)
:
Promise
.
resolve
(
undefined
);
});
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugSession.ts
浏览文件 @
f9281d83
...
...
@@ -13,7 +13,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import
{
CompletionItem
,
completionKindFromLegacyString
}
from
'
vs/editor/common/modes
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
*
as
aria
from
'
vs/base/browser/ui/aria/aria
'
;
import
{
IDebugSession
,
IConfig
,
IThread
,
IRawModelUpdate
,
IDebugService
,
IRawStoppedDetails
,
State
,
LoadedSourceEvent
,
IFunctionBreakpoint
,
IExceptionBreakpoint
,
ActualBreakpoints
,
IBreakpoint
,
IExceptionInfo
,
AdapterEndEvent
,
IDebugger
,
VIEWLET_ID
,
IDebugConfiguration
,
IReplElement
,
IStackFrame
,
IExpression
,
IReplElementSource
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IDebugSession
,
IConfig
,
IThread
,
IRawModelUpdate
,
IDebugService
,
IRawStoppedDetails
,
State
,
LoadedSourceEvent
,
IFunctionBreakpoint
,
IExceptionBreakpoint
,
IBreakpoint
,
IExceptionInfo
,
AdapterEndEvent
,
IDebugger
,
VIEWLET_ID
,
IDebugConfiguration
,
IReplElement
,
IStackFrame
,
IExpression
,
IReplElementSource
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
Source
}
from
'
vs/workbench/parts/debug/common/debugSource
'
;
import
{
mixin
}
from
'
vs/base/common/objects
'
;
import
{
Thread
,
ExpressionContainer
,
DebugModel
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
...
...
@@ -230,7 +230,7 @@ export class DebugSession implements IDebugSession {
return
Promise
.
reject
(
new
Error
(
'
no debug adapter
'
));
}
sendBreakpoints
(
modelUri
:
URI
,
breakpointsToSend
:
IBreakpoint
[],
sourceModified
:
boolean
):
TPromise
<
ActualBreakpoints
|
undefine
d
>
{
sendBreakpoints
(
modelUri
:
URI
,
breakpointsToSend
:
IBreakpoint
[],
sourceModified
:
boolean
):
TPromise
<
voi
d
>
{
if
(
!
this
.
raw
)
{
return
Promise
.
reject
(
new
Error
(
'
no debug adapter
'
));
...
...
@@ -261,35 +261,34 @@ export class DebugSession implements IDebugSession {
breakpoints
:
breakpointsToSend
.
map
(
bp
=>
({
line
:
bp
.
lineNumber
,
column
:
bp
.
column
,
condition
:
bp
.
condition
,
hitCondition
:
bp
.
hitCondition
,
logMessage
:
bp
.
logMessage
})),
sourceModified
}).
then
(
response
=>
{
if
(
response
&&
response
.
body
)
{
const
data
:
ActualBreakpoints
=
Object
.
create
(
null
);
const
data
:
{
[
id
:
string
]:
DebugProtocol
.
Breakpoint
}
=
Object
.
create
(
null
);
for
(
let
i
=
0
;
i
<
breakpointsToSend
.
length
;
i
++
)
{
data
[
breakpointsToSend
[
i
].
getId
()]
=
response
.
body
.
breakpoints
[
i
];
}
this
.
model
.
setBreakpointSessionData
(
this
.
getId
(),
data
);
return
data
;
}
return
undefined
;
});
}
sendFunctionBreakpoints
(
fbpts
:
IFunctionBreakpoint
[]):
TPromise
<
ActualBreakpoints
|
undefine
d
>
{
sendFunctionBreakpoints
(
fbpts
:
IFunctionBreakpoint
[]):
TPromise
<
voi
d
>
{
if
(
this
.
raw
)
{
if
(
this
.
raw
.
readyForBreakpoints
)
{
return
this
.
raw
.
setFunctionBreakpoints
({
breakpoints
:
fbpts
}).
then
(
response
=>
{
if
(
response
&&
response
.
body
)
{
const
data
:
ActualBreakpoints
=
Object
.
create
(
null
);
const
data
:
{
[
id
:
string
]:
DebugProtocol
.
Breakpoint
}
=
Object
.
create
(
null
);
for
(
let
i
=
0
;
i
<
fbpts
.
length
;
i
++
)
{
data
[
fbpts
[
i
].
getId
()]
=
response
.
body
.
breakpoints
[
i
];
}
return
data
;
this
.
model
.
setBreakpointSessionData
(
this
.
getId
(),
data
)
;
}
return
undefined
;
});
}
return
Promise
.
resolve
(
undefined
);
return
TPromise
.
as
(
undefined
);
}
return
Promise
.
reject
(
new
Error
(
'
no debug adapter
'
));
}
...
...
src/vs/workbench/parts/debug/test/common/mockDebug.ts
浏览文件 @
f9281d83
...
...
@@ -8,7 +8,7 @@ import { Event } from 'vs/base/common/event';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
ILaunch
,
IDebugService
,
State
,
IDebugSession
,
IConfigurationManager
,
IStackFrame
,
IBreakpointData
,
IBreakpointUpdateData
,
IConfig
,
IDebugModel
,
IViewModel
,
IBreakpoint
,
LoadedSourceEvent
,
IThread
,
IRawModelUpdate
,
ActualBreakpoints
,
IFunctionBreakpoint
,
IExceptionBreakpoint
,
IDebugger
,
IExceptionInfo
,
AdapterEndEvent
,
IReplElement
,
IExpression
,
IReplElementSource
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
ILaunch
,
IDebugService
,
State
,
IDebugSession
,
IConfigurationManager
,
IStackFrame
,
IBreakpointData
,
IBreakpointUpdateData
,
IConfig
,
IDebugModel
,
IViewModel
,
IBreakpoint
,
LoadedSourceEvent
,
IThread
,
IRawModelUpdate
,
IFunctionBreakpoint
,
IExceptionBreakpoint
,
IDebugger
,
IExceptionInfo
,
AdapterEndEvent
,
IReplElement
,
IExpression
,
IReplElementSource
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
Source
}
from
'
vs/workbench/parts/debug/common/debugSource
'
;
import
{
CompletionItem
}
from
'
vs/editor/common/modes
'
;
import
Severity
from
'
vs/base/common/severity
'
;
...
...
@@ -209,10 +209,10 @@ export class MockSession implements IDebugSession {
restart
():
TPromise
<
void
>
{
throw
new
Error
(
'
Method not implemented.
'
);
}
sendBreakpoints
(
modelUri
:
uri
,
bpts
:
IBreakpoint
[],
sourceModified
:
boolean
):
TPromise
<
ActualBreakpoints
>
{
sendBreakpoints
(
modelUri
:
uri
,
bpts
:
IBreakpoint
[],
sourceModified
:
boolean
):
TPromise
<
void
>
{
throw
new
Error
(
'
Method not implemented.
'
);
}
sendFunctionBreakpoints
(
fbps
:
IFunctionBreakpoint
[]):
TPromise
<
ActualBreakpoints
>
{
sendFunctionBreakpoints
(
fbps
:
IFunctionBreakpoint
[]):
TPromise
<
void
>
{
throw
new
Error
(
'
Method not implemented.
'
);
}
sendExceptionBreakpoints
(
exbpts
:
IExceptionBreakpoint
[]):
TPromise
<
void
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录