Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2b6a9d40
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,发现更多精彩内容 >>
提交
2b6a9d40
编写于
9月 18, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debugSession: _raw -> raw, also remove nullCapabilities
上级
a689dc25
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
89 addition
and
91 deletion
+89
-91
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/debugSession.ts
...vs/workbench/parts/debug/electron-browser/debugSession.ts
+85
-87
src/vs/workbench/parts/debug/test/electron-browser/debugModel.test.ts
...ench/parts/debug/test/electron-browser/debugModel.test.ts
+3
-3
未找到文件。
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
2b6a9d40
...
...
@@ -162,7 +162,7 @@ export interface IDebugSession extends ITreeElement {
readonly
onDidLoadedSource
:
Event
<
LoadedSourceEvent
>
;
readonly
onDidCustomEvent
:
Event
<
DebugProtocol
.
Event
>
;
// Disconnects and clears state
// Disconnects and clears state
. Session can be initialized again for a new connection.
shutdown
():
void
;
// DAP request
...
...
src/vs/workbench/parts/debug/electron-browser/debugSession.ts
浏览文件 @
2b6a9d40
...
...
@@ -31,9 +31,8 @@ import { IOutputService } from 'vs/workbench/parts/output/common/output';
export
class
DebugSession
implements
IDebugSession
{
private
id
:
string
;
private
_
raw
:
RawDebugSession
;
private
raw
:
RawDebugSession
;
private
_state
:
State
;
private
_nullCapabilities
:
DebugProtocol
.
Capabilities
;
private
sources
=
new
Map
<
string
,
Source
>
();
private
threads
=
new
Map
<
number
,
Thread
>
();
...
...
@@ -58,7 +57,6 @@ export class DebugSession implements IDebugSession {
)
{
this
.
id
=
generateUuid
();
this
.
state
=
State
.
Initializing
;
this
.
_nullCapabilities
=
Object
.
create
(
null
);
}
getId
():
string
{
...
...
@@ -89,7 +87,7 @@ export class DebugSession implements IDebugSession {
}
get
capabilities
():
DebugProtocol
.
Capabilities
{
return
this
.
_raw
?
this
.
_raw
.
capabilities
:
this
.
_nullCapabilities
;
return
this
.
raw
?
this
.
raw
.
capabilities
:
Object
.
create
(
null
)
;
}
//---- events
...
...
@@ -120,7 +118,7 @@ export class DebugSession implements IDebugSession {
*/
initialize
(
dbgr
:
IDebugger
):
TPromise
<
void
>
{
if
(
this
.
_
raw
)
{
if
(
this
.
raw
)
{
// if there was already a connection make sure to remove old listeners
this
.
shutdown
();
}
...
...
@@ -129,13 +127,13 @@ export class DebugSession implements IDebugSession {
return
dbgr
.
createDebugAdapter
(
this
,
this
.
root
,
this
.
_configuration
.
resolved
,
this
.
outputService
).
then
(
debugAdapter
=>
{
this
.
_
raw
=
new
RawDebugSession
(
debugAdapter
,
dbgr
,
this
.
telemetryService
,
customTelemetryService
);
this
.
raw
=
new
RawDebugSession
(
debugAdapter
,
dbgr
,
this
.
telemetryService
,
customTelemetryService
);
return
this
.
_
raw
.
start
().
then
(()
=>
{
return
this
.
raw
.
start
().
then
(()
=>
{
this
.
registerListeners
();
return
this
.
_
raw
.
initialize
({
return
this
.
raw
.
initialize
({
clientID
:
'
vscode
'
,
clientName
:
product
.
nameLong
,
adapterID
:
this
.
configuration
.
type
,
...
...
@@ -149,7 +147,7 @@ export class DebugSession implements IDebugSession {
}).
then
(
response
=>
{
this
.
model
.
addSession
(
this
);
this
.
state
=
State
.
Running
;
this
.
model
.
setExceptionBreakpoints
(
this
.
_
raw
.
capabilities
.
exceptionBreakpointFilters
);
this
.
model
.
setExceptionBreakpoints
(
this
.
raw
.
capabilities
.
exceptionBreakpointFilters
);
});
});
});
...
...
@@ -160,12 +158,12 @@ export class DebugSession implements IDebugSession {
* launch or attach to the debuggee
*/
launchOrAttach
(
config
:
IConfig
):
TPromise
<
void
>
{
if
(
this
.
_
raw
)
{
if
(
this
.
raw
)
{
// __sessionID only used for EH debugging (but we add it always for now...)
config
.
__sessionId
=
this
.
getId
();
return
this
.
_
raw
.
launchOrAttach
(
config
).
then
(
result
=>
{
return
this
.
raw
.
launchOrAttach
(
config
).
then
(
result
=>
{
return
void
0
;
});
}
...
...
@@ -176,13 +174,13 @@ export class DebugSession implements IDebugSession {
* end the current debug adapter session
*/
terminate
(
restart
=
false
):
TPromise
<
void
>
{
if
(
this
.
_
raw
)
{
if
(
this
.
_
raw
.
capabilities
.
supportsTerminateRequest
&&
this
.
_configuration
.
resolved
.
request
===
'
launch
'
)
{
return
this
.
_
raw
.
terminate
(
restart
).
then
(
response
=>
{
if
(
this
.
raw
)
{
if
(
this
.
raw
.
capabilities
.
supportsTerminateRequest
&&
this
.
_configuration
.
resolved
.
request
===
'
launch
'
)
{
return
this
.
raw
.
terminate
(
restart
).
then
(
response
=>
{
return
void
0
;
});
}
return
this
.
_
raw
.
disconnect
(
restart
).
then
(
response
=>
{
return
this
.
raw
.
disconnect
(
restart
).
then
(
response
=>
{
return
void
0
;
});
}
...
...
@@ -193,8 +191,8 @@ export class DebugSession implements IDebugSession {
* end the current debug adapter session
*/
disconnect
(
restart
=
false
):
TPromise
<
void
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
disconnect
(
restart
).
then
(
response
=>
{
if
(
this
.
raw
)
{
return
this
.
raw
.
disconnect
(
restart
).
then
(
response
=>
{
return
void
0
;
});
}
...
...
@@ -205,19 +203,19 @@ export class DebugSession implements IDebugSession {
* restart debug adapter session
*/
restart
():
TPromise
<
DebugProtocol
.
RestartResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
restart
();
if
(
this
.
raw
)
{
return
this
.
raw
.
restart
();
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
sendBreakpoints
(
modelUri
:
uri
,
breakpointsToSend
:
IBreakpoint
[],
sourceModified
:
boolean
):
TPromise
<
ActualBreakpoints
|
undefined
>
{
if
(
!
this
.
_
raw
)
{
if
(
!
this
.
raw
)
{
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
if
(
!
this
.
_
raw
.
readyForBreakpoints
)
{
if
(
!
this
.
raw
.
readyForBreakpoints
)
{
return
TPromise
.
as
(
undefined
);
}
...
...
@@ -236,7 +234,7 @@ export class DebugSession implements IDebugSession {
// Normalize all drive letters going out from vscode to debug adapters so we are consistent with our resolving #43959
rawSource
.
path
=
normalizeDriveLetter
(
rawSource
.
path
);
return
this
.
_
raw
.
setBreakpoints
({
return
this
.
raw
.
setBreakpoints
({
source
:
rawSource
,
lines
:
breakpointsToSend
.
map
(
bp
=>
bp
.
lineNumber
),
breakpoints
:
breakpointsToSend
.
map
(
bp
=>
({
line
:
bp
.
lineNumber
,
column
:
bp
.
column
,
condition
:
bp
.
condition
,
hitCondition
:
bp
.
hitCondition
,
logMessage
:
bp
.
logMessage
})),
...
...
@@ -256,9 +254,9 @@ export class DebugSession implements IDebugSession {
}
sendFunctionBreakpoints
(
fbpts
:
IFunctionBreakpoint
[]):
TPromise
<
ActualBreakpoints
|
undefined
>
{
if
(
this
.
_
raw
)
{
if
(
this
.
_
raw
.
readyForBreakpoints
)
{
return
this
.
_
raw
.
setFunctionBreakpoints
({
breakpoints
:
fbpts
}).
then
(
response
=>
{
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
);
for
(
let
i
=
0
;
i
<
fbpts
.
length
;
i
++
)
{
...
...
@@ -275,9 +273,9 @@ export class DebugSession implements IDebugSession {
}
sendExceptionBreakpoints
(
exbpts
:
IExceptionBreakpoint
[]):
TPromise
<
any
>
{
if
(
this
.
_
raw
)
{
if
(
this
.
_
raw
.
readyForBreakpoints
&&
exbpts
.
length
>
0
)
{
return
this
.
_
raw
.
setExceptionBreakpoints
({
filters
:
exbpts
.
map
(
exb
=>
exb
.
filter
)
});
if
(
this
.
raw
)
{
if
(
this
.
raw
.
readyForBreakpoints
&&
exbpts
.
length
>
0
)
{
return
this
.
raw
.
setExceptionBreakpoints
({
filters
:
exbpts
.
map
(
exb
=>
exb
.
filter
)
});
}
return
TPromise
.
as
(
null
);
}
...
...
@@ -285,22 +283,22 @@ export class DebugSession implements IDebugSession {
}
customRequest
(
request
:
string
,
args
:
any
):
TPromise
<
DebugProtocol
.
Response
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
custom
(
request
,
args
);
if
(
this
.
raw
)
{
return
this
.
raw
.
custom
(
request
,
args
);
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
stackTrace
(
threadId
:
number
,
startFrame
:
number
,
levels
:
number
):
TPromise
<
DebugProtocol
.
StackTraceResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
stackTrace
({
threadId
,
startFrame
,
levels
});
if
(
this
.
raw
)
{
return
this
.
raw
.
stackTrace
({
threadId
,
startFrame
,
levels
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
exceptionInfo
(
threadId
:
number
):
TPromise
<
IExceptionInfo
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
exceptionInfo
({
threadId
}).
then
(
response
=>
{
if
(
this
.
raw
)
{
return
this
.
raw
.
exceptionInfo
({
threadId
}).
then
(
response
=>
{
if
(
response
)
{
return
{
id
:
response
.
body
.
exceptionId
,
...
...
@@ -316,99 +314,99 @@ export class DebugSession implements IDebugSession {
}
scopes
(
frameId
:
number
):
TPromise
<
DebugProtocol
.
ScopesResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
scopes
({
frameId
});
if
(
this
.
raw
)
{
return
this
.
raw
.
scopes
({
frameId
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
variables
(
variablesReference
:
number
,
filter
:
'
indexed
'
|
'
named
'
,
start
:
number
,
count
:
number
):
TPromise
<
DebugProtocol
.
VariablesResponse
|
undefined
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
variables
({
variablesReference
,
filter
,
start
,
count
});
if
(
this
.
raw
)
{
return
this
.
raw
.
variables
({
variablesReference
,
filter
,
start
,
count
});
}
return
TPromise
.
as
(
undefined
);
}
evaluate
(
expression
:
string
,
frameId
:
number
,
context
?:
string
):
TPromise
<
DebugProtocol
.
EvaluateResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
evaluate
({
expression
,
frameId
,
context
});
if
(
this
.
raw
)
{
return
this
.
raw
.
evaluate
({
expression
,
frameId
,
context
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
restartFrame
(
frameId
:
number
,
threadId
:
number
):
TPromise
<
DebugProtocol
.
RestartFrameResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
restartFrame
({
frameId
},
threadId
);
if
(
this
.
raw
)
{
return
this
.
raw
.
restartFrame
({
frameId
},
threadId
);
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
next
(
threadId
:
number
):
TPromise
<
DebugProtocol
.
NextResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
next
({
threadId
});
if
(
this
.
raw
)
{
return
this
.
raw
.
next
({
threadId
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
stepIn
(
threadId
:
number
):
TPromise
<
DebugProtocol
.
StepInResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
stepIn
({
threadId
});
if
(
this
.
raw
)
{
return
this
.
raw
.
stepIn
({
threadId
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
stepOut
(
threadId
:
number
):
TPromise
<
DebugProtocol
.
StepOutResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
stepOut
({
threadId
});
if
(
this
.
raw
)
{
return
this
.
raw
.
stepOut
({
threadId
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
stepBack
(
threadId
:
number
):
TPromise
<
DebugProtocol
.
StepBackResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
stepBack
({
threadId
});
if
(
this
.
raw
)
{
return
this
.
raw
.
stepBack
({
threadId
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
continue
(
threadId
:
number
):
TPromise
<
DebugProtocol
.
ContinueResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
continue
({
threadId
});
if
(
this
.
raw
)
{
return
this
.
raw
.
continue
({
threadId
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
reverseContinue
(
threadId
:
number
):
TPromise
<
DebugProtocol
.
ReverseContinueResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
reverseContinue
({
threadId
});
if
(
this
.
raw
)
{
return
this
.
raw
.
reverseContinue
({
threadId
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
pause
(
threadId
:
number
):
TPromise
<
DebugProtocol
.
PauseResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
pause
({
threadId
});
if
(
this
.
raw
)
{
return
this
.
raw
.
pause
({
threadId
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
terminateThreads
(
threadIds
?:
number
[]):
TPromise
<
DebugProtocol
.
TerminateThreadsResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
terminateThreads
({
threadIds
});
if
(
this
.
raw
)
{
return
this
.
raw
.
terminateThreads
({
threadIds
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
setVariable
(
variablesReference
:
number
,
name
:
string
,
value
:
string
):
TPromise
<
DebugProtocol
.
SetVariableResponse
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
setVariable
({
variablesReference
,
name
,
value
});
if
(
this
.
raw
)
{
return
this
.
raw
.
setVariable
({
variablesReference
,
name
,
value
});
}
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
loadSource
(
resource
:
uri
):
TPromise
<
DebugProtocol
.
SourceResponse
>
{
if
(
!
this
.
_
raw
)
{
if
(
!
this
.
raw
)
{
return
TPromise
.
wrapError
(
new
Error
(
'
no debug adapter
'
));
}
...
...
@@ -431,12 +429,12 @@ export class DebugSession implements IDebugSession {
};
}
return
this
.
_
raw
.
source
({
sourceReference
:
rawSource
.
sourceReference
,
source
:
rawSource
});
return
this
.
raw
.
source
({
sourceReference
:
rawSource
.
sourceReference
,
source
:
rawSource
});
}
getLoadedSources
():
TPromise
<
Source
[]
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
loadedSources
({}).
then
(
response
=>
{
if
(
this
.
raw
)
{
return
this
.
raw
.
loadedSources
({}).
then
(
response
=>
{
return
response
.
body
.
sources
.
map
(
src
=>
this
.
getSource
(
src
));
},
()
=>
{
return
[];
...
...
@@ -446,8 +444,8 @@ export class DebugSession implements IDebugSession {
}
completions
(
frameId
:
number
,
text
:
string
,
position
:
Position
,
overwriteBefore
:
number
):
TPromise
<
ISuggestion
[]
>
{
if
(
this
.
_
raw
)
{
return
this
.
_
raw
.
completions
({
if
(
this
.
raw
)
{
return
this
.
raw
.
completions
({
frameId
,
text
,
column
:
position
.
column
,
...
...
@@ -543,7 +541,7 @@ export class DebugSession implements IDebugSession {
}
private
fetchThreads
(
stoppedDetails
?:
IRawStoppedDetails
):
TPromise
<
any
>
{
return
this
.
_
raw
.
threads
().
then
(
response
=>
{
return
this
.
raw
.
threads
().
then
(
response
=>
{
if
(
response
&&
response
.
body
&&
response
.
body
.
threads
)
{
response
.
body
.
threads
.
forEach
(
thread
=>
{
this
.
model
.
rawUpdate
({
...
...
@@ -561,14 +559,14 @@ export class DebugSession implements IDebugSession {
private
registerListeners
():
void
{
this
.
rawListeners
.
push
(
this
.
_
raw
.
onDidInitialize
(()
=>
{
this
.
rawListeners
.
push
(
this
.
raw
.
onDidInitialize
(()
=>
{
aria
.
status
(
nls
.
localize
(
'
debuggingStarted
'
,
"
Debugging started.
"
));
const
sendConfigurationDone
=
()
=>
{
if
(
this
.
_raw
&&
this
.
_
raw
.
capabilities
.
supportsConfigurationDoneRequest
)
{
return
this
.
_
raw
.
configurationDone
().
then
(
null
,
e
=>
{
if
(
this
.
raw
&&
this
.
raw
.
capabilities
.
supportsConfigurationDoneRequest
)
{
return
this
.
raw
.
configurationDone
().
then
(
null
,
e
=>
{
// Disconnect the debug session on configuration done error #10596
if
(
this
.
_
raw
)
{
this
.
_
raw
.
disconnect
();
if
(
this
.
raw
)
{
this
.
raw
.
disconnect
();
}
this
.
notificationService
.
error
(
e
.
message
);
});
...
...
@@ -582,7 +580,7 @@ export class DebugSession implements IDebugSession {
.
then
(()
=>
this
.
fetchThreads
());
}));
this
.
rawListeners
.
push
(
this
.
_
raw
.
onDidStop
(
event
=>
{
this
.
rawListeners
.
push
(
this
.
raw
.
onDidStop
(
event
=>
{
this
.
state
=
State
.
Stopped
;
this
.
fetchThreads
(
event
.
body
).
then
(()
=>
{
const
thread
=
this
.
getThread
(
event
.
body
.
threadId
);
...
...
@@ -596,7 +594,7 @@ export class DebugSession implements IDebugSession {
});
}));
this
.
rawListeners
.
push
(
this
.
_
raw
.
onDidThread
(
event
=>
{
this
.
rawListeners
.
push
(
this
.
raw
.
onDidThread
(
event
=>
{
if
(
event
.
body
.
reason
===
'
started
'
)
{
// debounce to reduce threadsRequest frequency and improve performance
if
(
!
this
.
fetchThreadsScheduler
)
{
...
...
@@ -613,23 +611,23 @@ export class DebugSession implements IDebugSession {
}
}));
this
.
rawListeners
.
push
(
this
.
_
raw
.
onDidTerminateDebugee
(
event
=>
{
this
.
rawListeners
.
push
(
this
.
raw
.
onDidTerminateDebugee
(
event
=>
{
aria
.
status
(
nls
.
localize
(
'
debuggingStopped
'
,
"
Debugging stopped.
"
));
if
(
event
.
body
&&
event
.
body
.
restart
)
{
this
.
debugService
.
restartSession
(
this
,
event
.
body
.
restart
).
then
(
null
,
err
=>
this
.
notificationService
.
error
(
err
.
message
));
}
else
{
this
.
_
raw
.
disconnect
();
this
.
raw
.
disconnect
();
}
}));
this
.
rawListeners
.
push
(
this
.
_
raw
.
onDidContinued
(
event
=>
{
this
.
rawListeners
.
push
(
this
.
raw
.
onDidContinued
(
event
=>
{
const
threadId
=
event
.
body
.
allThreadsContinued
!==
false
?
undefined
:
event
.
body
.
threadId
;
this
.
model
.
clearThreads
(
this
.
getId
(),
false
,
threadId
);
this
.
state
=
State
.
Running
;
}));
let
outputPromises
:
TPromise
<
void
>
[]
=
[];
this
.
rawListeners
.
push
(
this
.
_
raw
.
onDidOutput
(
event
=>
{
this
.
rawListeners
.
push
(
this
.
raw
.
onDidOutput
(
event
=>
{
if
(
!
event
.
body
)
{
return
;
}
...
...
@@ -638,9 +636,9 @@ export class DebugSession implements IDebugSession {
if
(
event
.
body
.
category
===
'
telemetry
'
)
{
// only log telemetry events from debug adapter if the debug extension provided the telemetry key
// and the user opted in telemetry
if
(
this
.
_
raw
.
customTelemetryService
&&
this
.
telemetryService
.
isOptedIn
)
{
if
(
this
.
raw
.
customTelemetryService
&&
this
.
telemetryService
.
isOptedIn
)
{
// __GDPR__TODO__ We're sending events in the name of the debug extension and we can not ensure that those are declared correctly.
this
.
_
raw
.
customTelemetryService
.
publicLog
(
event
.
body
.
output
,
event
.
body
.
data
);
this
.
raw
.
customTelemetryService
.
publicLog
(
event
.
body
.
output
,
event
.
body
.
data
);
}
return
;
...
...
@@ -668,7 +666,7 @@ export class DebugSession implements IDebugSession {
TPromise
.
join
(
outputPromises
).
then
(()
=>
outputPromises
=
[]);
}));
this
.
rawListeners
.
push
(
this
.
_
raw
.
onDidBreakpoint
(
event
=>
{
this
.
rawListeners
.
push
(
this
.
raw
.
onDidBreakpoint
(
event
=>
{
const
id
=
event
.
body
&&
event
.
body
.
breakpoint
?
event
.
body
.
breakpoint
.
id
:
undefined
;
const
breakpoint
=
this
.
model
.
getBreakpoints
().
filter
(
bp
=>
bp
.
idFromAdapter
===
id
).
pop
();
const
functionBreakpoint
=
this
.
model
.
getFunctionBreakpoints
().
filter
(
bp
=>
bp
.
idFromAdapter
===
id
).
pop
();
...
...
@@ -707,18 +705,18 @@ export class DebugSession implements IDebugSession {
}
}));
this
.
rawListeners
.
push
(
this
.
_
raw
.
onDidLoadedSource
(
event
=>
{
this
.
rawListeners
.
push
(
this
.
raw
.
onDidLoadedSource
(
event
=>
{
this
.
_onDidLoadedSource
.
fire
({
reason
:
event
.
body
.
reason
,
source
:
this
.
getSource
(
event
.
body
.
source
)
});
}));
this
.
rawListeners
.
push
(
this
.
_
raw
.
onDidCustomEvent
(
event
=>
{
this
.
rawListeners
.
push
(
this
.
raw
.
onDidCustomEvent
(
event
=>
{
this
.
_onDidCustomEvent
.
fire
(
event
);
}));
this
.
rawListeners
.
push
(
this
.
_
raw
.
onDidExitAdapter
(
event
=>
{
this
.
rawListeners
.
push
(
this
.
raw
.
onDidExitAdapter
(
event
=>
{
this
.
_onDidEndAdapter
.
fire
(
event
);
}));
}
...
...
@@ -728,10 +726,10 @@ export class DebugSession implements IDebugSession {
this
.
model
.
clearThreads
(
this
.
getId
(),
true
);
this
.
model
.
removeSession
(
this
.
getId
());
this
.
fetchThreadsScheduler
=
undefined
;
if
(
this
.
_
raw
)
{
this
.
_
raw
.
disconnect
();
if
(
this
.
raw
)
{
this
.
raw
.
disconnect
();
}
this
.
_
raw
=
undefined
;
this
.
raw
=
undefined
;
}
//---- sources
...
...
src/vs/workbench/parts/debug/test/electron-browser/debugModel.test.ts
浏览文件 @
2b6a9d40
...
...
@@ -144,7 +144,7 @@ suite('Debug - Model', () => {
const
session
=
new
DebugSession
({
resolved
:
{
name
:
'
mockSession
'
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
,
model
,
undefined
,
undefined
,
undefined
,
undefined
);
model
.
addSession
(
session
);
session
[
'
_
raw
'
]
=
<
any
>
rawSession
;
session
[
'
raw
'
]
=
<
any
>
rawSession
;
model
.
rawUpdate
({
sessionId
:
session
.
getId
(),
...
...
@@ -237,7 +237,7 @@ suite('Debug - Model', () => {
const
session
=
new
DebugSession
({
resolved
:
{
name
:
'
mockSession
'
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
,
model
,
undefined
,
undefined
,
undefined
,
undefined
);
model
.
addSession
(
session
);
session
[
'
_
raw
'
]
=
<
any
>
rawSession
;
session
[
'
raw
'
]
=
<
any
>
rawSession
;
// Add the threads
model
.
rawUpdate
({
...
...
@@ -351,7 +351,7 @@ suite('Debug - Model', () => {
const
session
=
new
DebugSession
({
resolved
:
{
name
:
'
mockSession
'
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
,
model
,
undefined
,
undefined
,
undefined
,
undefined
);
model
.
addSession
(
session
);
session
[
'
_
raw
'
]
=
<
any
>
rawSession
;
session
[
'
raw
'
]
=
<
any
>
rawSession
;
const
thread
=
new
Thread
(
session
,
'
mockthread
'
,
1
);
const
stackFrame
=
new
StackFrame
(
thread
,
1
,
null
,
'
app.js
'
,
'
normal
'
,
{
startLineNumber
:
1
,
startColumn
:
1
,
endLineNumber
:
1
,
endColumn
:
10
},
1
);
model
.
addReplExpression
(
session
,
stackFrame
,
'
myVariable
'
).
then
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录