Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f168d882
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,发现更多精彩内容 >>
提交
f168d882
编写于
11月 30, 2018
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
final tracker API; for #62843
上级
72812c41
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
54 addition
and
27 deletion
+54
-27
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+36
-9
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+18
-18
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
f168d882
...
@@ -508,15 +508,30 @@ declare module 'vscode' {
...
@@ -508,15 +508,30 @@ declare module 'vscode' {
* A Debug Adapter Tracker is a means to track the communication between VS Code and a Debug Adapter.
* A Debug Adapter Tracker is a means to track the communication between VS Code and a Debug Adapter.
*/
*/
export
interface
DebugAdapterTracker
{
export
interface
DebugAdapterTracker
{
// VS Code -> Debug Adapter
/**
startDebugAdapter
?():
void
;
* A session with the debug adapter is about to be started.
toDebugAdapter
?(
message
:
any
):
void
;
*/
stopDebugAdapter
?():
void
;
onWillStartSession
?():
void
;
/**
// Debug Adapter -> VS Code
* The debug adapter is about to receive a Debug Adapter Protocol message from VS Code.
fromDebugAdapter
?(
message
:
any
):
void
;
*/
debugAdapterError
?(
error
:
Error
):
void
;
onWillReceiveMessage
?(
message
:
any
):
void
;
debugAdapterExit
?(
code
?:
number
,
signal
?:
string
):
void
;
/**
* The debug adapter has sent a Debug Adapter Protocol message to VS Code.
*/
onDidSendMessage
?(
message
:
any
):
void
;
/**
* The debug adapter session is about to be stopped.
*/
onWillStopSession
?():
void
;
/**
* An error with the debug adapter has occured.
*/
onError
?(
error
:
Error
):
void
;
/**
* The debug adapter has exited with the given exit code or signal.
*/
onExit
?(
code
:
number
|
undefined
,
signal
:
string
|
undefined
):
void
;
}
}
export
interface
DebugAdapterTrackerFactory
{
export
interface
DebugAdapterTrackerFactory
{
...
@@ -543,6 +558,18 @@ declare module 'vscode' {
...
@@ -543,6 +558,18 @@ declare module 'vscode' {
// deprecated
// deprecated
export
interface
DebugAdapterTracker
{
// VS Code -> Debug Adapter
startDebugAdapter
?():
void
;
toDebugAdapter
?(
message
:
any
):
void
;
stopDebugAdapter
?():
void
;
// Debug Adapter -> VS Code
fromDebugAdapter
?(
message
:
any
):
void
;
debugAdapterError
?(
error
:
Error
):
void
;
debugAdapterExit
?(
code
?:
number
,
signal
?:
string
):
void
;
}
export
interface
DebugConfigurationProvider
{
export
interface
DebugConfigurationProvider
{
/**
/**
* Deprecated, use DebugAdapterDescriptorFactory.provideDebugAdapter instead.
* Deprecated, use DebugAdapterDescriptorFactory.provideDebugAdapter instead.
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
f168d882
...
@@ -420,7 +420,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
...
@@ -420,7 +420,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
da
.
onMessage
(
message
=>
{
da
.
onMessage
(
message
=>
{
if
(
tracker
)
{
if
(
tracker
)
{
tracker
.
fromDebugAdapter
(
message
);
tracker
.
onDidSendMessage
(
message
);
}
}
// DA -> VS Code
// DA -> VS Code
...
@@ -430,19 +430,19 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
...
@@ -430,19 +430,19 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
});
});
da
.
onError
(
err
=>
{
da
.
onError
(
err
=>
{
if
(
tracker
)
{
if
(
tracker
)
{
tracker
.
debugAdapter
Error
(
err
);
tracker
.
on
Error
(
err
);
}
}
this
.
_debugServiceProxy
.
$acceptDAError
(
debugAdapterHandle
,
err
.
name
,
err
.
message
,
err
.
stack
);
this
.
_debugServiceProxy
.
$acceptDAError
(
debugAdapterHandle
,
err
.
name
,
err
.
message
,
err
.
stack
);
});
});
da
.
onExit
(
code
=>
{
da
.
onExit
(
code
=>
{
if
(
tracker
)
{
if
(
tracker
)
{
tracker
.
debugAdapterExit
(
code
,
null
);
tracker
.
onExit
(
code
,
undefined
);
}
}
this
.
_debugServiceProxy
.
$acceptDAExit
(
debugAdapterHandle
,
code
,
null
);
this
.
_debugServiceProxy
.
$acceptDAExit
(
debugAdapterHandle
,
code
,
null
);
});
});
if
(
tracker
)
{
if
(
tracker
)
{
tracker
.
startDebugAdapter
();
tracker
.
onWillStartSession
();
}
}
return
da
.
startSession
();
return
da
.
startSession
();
...
@@ -460,7 +460,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
...
@@ -460,7 +460,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
const
tracker
=
this
.
_debugAdaptersTrackers
.
get
(
debugAdapterHandle
);
// TODO@AW: same handle?
const
tracker
=
this
.
_debugAdaptersTrackers
.
get
(
debugAdapterHandle
);
// TODO@AW: same handle?
if
(
tracker
)
{
if
(
tracker
)
{
tracker
.
toDebugAdapter
(
message
);
tracker
.
onWillReceiveMessage
(
message
);
}
}
const
da
=
this
.
_debugAdapters
.
get
(
debugAdapterHandle
);
const
da
=
this
.
_debugAdapters
.
get
(
debugAdapterHandle
);
...
@@ -475,7 +475,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
...
@@ -475,7 +475,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
const
tracker
=
this
.
_debugAdaptersTrackers
.
get
(
debugAdapterHandle
);
const
tracker
=
this
.
_debugAdaptersTrackers
.
get
(
debugAdapterHandle
);
this
.
_debugAdaptersTrackers
.
delete
(
debugAdapterHandle
);
this
.
_debugAdaptersTrackers
.
delete
(
debugAdapterHandle
);
if
(
tracker
)
{
if
(
tracker
)
{
tracker
.
stopDebugAdapter
();
tracker
.
onWillStopSession
();
}
}
const
da
=
this
.
_debugAdapters
.
get
(
debugAdapterHandle
);
const
da
=
this
.
_debugAdapters
.
get
(
debugAdapterHandle
);
...
@@ -929,28 +929,28 @@ class MultiTracker implements vscode.DebugAdapterTracker {
...
@@ -929,28 +929,28 @@ class MultiTracker implements vscode.DebugAdapterTracker {
constructor
(
private
trackers
:
vscode
.
DebugAdapterTracker
[])
{
constructor
(
private
trackers
:
vscode
.
DebugAdapterTracker
[])
{
}
}
startDebugAdapter
():
void
{
onWillStartSession
():
void
{
this
.
trackers
.
forEach
(
t
=>
t
.
startDebugAdapter
?
t
.
startDebugAdapter
()
:
void
0
);
this
.
trackers
.
forEach
(
t
=>
t
.
onWillStartSession
?
t
.
onWillStartSession
()
:
(
t
.
startDebugAdapter
?
t
.
startDebugAdapter
()
:
void
0
)
);
}
}
toDebugAdapter
(
message
:
any
):
void
{
onWillReceiveMessage
(
message
:
any
):
void
{
this
.
trackers
.
forEach
(
t
=>
t
.
toDebugAdapter
?
t
.
toDebugAdapter
(
message
)
:
void
0
);
this
.
trackers
.
forEach
(
t
=>
t
.
onWillReceiveMessage
?
t
.
onWillReceiveMessage
(
message
)
:
(
t
.
toDebugAdapter
?
t
.
toDebugAdapter
(
message
)
:
void
0
)
);
}
}
fromDebugAdapter
(
message
:
any
):
void
{
onDidSendMessage
(
message
:
any
):
void
{
this
.
trackers
.
forEach
(
t
=>
t
.
fromDebugAdapter
?
t
.
fromDebugAdapter
(
message
)
:
void
0
);
this
.
trackers
.
forEach
(
t
=>
t
.
onDidSendMessage
?
t
.
onDidSendMessage
(
message
)
:
(
t
.
fromDebugAdapter
?
t
.
fromDebugAdapter
(
message
)
:
void
0
)
);
}
}
debugAdapterError
(
error
:
Error
):
void
{
onWillStopSession
(
):
void
{
this
.
trackers
.
forEach
(
t
=>
t
.
debugAdapterError
?
t
.
debugAdapterError
(
error
)
:
void
0
);
this
.
trackers
.
forEach
(
t
=>
t
.
onWillStopSession
?
t
.
onWillStopSession
()
:
(
t
.
stopDebugAdapter
?
t
.
stopDebugAdapter
()
:
void
0
)
);
}
}
debugAdapterExit
(
code
:
number
,
signal
:
string
):
void
{
onError
(
error
:
Error
):
void
{
this
.
trackers
.
forEach
(
t
=>
t
.
debugAdapterExit
?
t
.
debugAdapterExit
(
code
,
signal
)
:
void
0
);
this
.
trackers
.
forEach
(
t
=>
t
.
onError
?
t
.
onError
(
error
)
:
(
t
.
debugAdapterError
?
t
.
debugAdapterError
(
error
)
:
void
0
)
);
}
}
stopDebugAdapter
(
):
void
{
onExit
(
code
:
number
,
signal
:
string
):
void
{
this
.
trackers
.
forEach
(
t
=>
t
.
stopDebugAdapter
?
t
.
stopDebugAdapter
()
:
void
0
);
this
.
trackers
.
forEach
(
t
=>
t
.
onExit
?
t
.
onExit
(
code
,
signal
)
:
(
t
.
debugAdapterExit
?
t
.
debugAdapterExit
(
code
,
signal
)
:
void
0
)
);
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录