Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
618fcaad
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 搜索 >>
提交
618fcaad
编写于
7月 11, 2017
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
incorporate debug API feedback
上级
7017d1bf
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
49 addition
and
20 deletion
+49
-20
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+28
-5
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
.../workbench/api/electron-browser/mainThreadDebugService.ts
+2
-1
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+3
-0
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+15
-13
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
618fcaad
...
...
@@ -190,6 +190,26 @@ declare module 'vscode' {
onData
(
callback
:
(
data
:
string
)
=>
any
):
void
;
}
/**
* A custom Debug Adapter Protocol event received from a [debug session](#DebugSession).
*/
export
interface
DebugSessionCustomEvent
{
/**
* The [debug session](#DebugSession) for which the custom event was received.
*/
session
:
DebugSession
;
/**
* Type of event.
*/
event
:
string
;
/**
* Event specific information.
*/
body
?:
any
;
}
export
namespace
debug
{
/**
...
...
@@ -197,7 +217,7 @@ declare module 'vscode' {
* represented by the debug action floating window or the one currently shown in the drop down menu of the debug action floating window.
* If no debug session is active, the value is `undefined`.
*/
export
cons
t
activeDebugSession
:
DebugSession
|
undefined
;
export
le
t
activeDebugSession
:
DebugSession
|
undefined
;
/**
* An [event](#Event) which fires when the [active debug session](#debug.activeDebugSession)
...
...
@@ -205,16 +225,19 @@ declare module 'vscode' {
* to `undefined`.
*/
export
const
onDidChangeActiveDebugSession
:
Event
<
DebugSession
|
undefined
>
;
/**
* An [event](#Event) which fires when a custom DAP event is received from the debug session.
*/
export
const
onDidReceiveDebugSessionCustomEvent
:
Event
<
DebugSessionCustomEvent
>
;
}
export
interface
DebugSession
{
/**
* Experimental API that allows hooking custom events from the debug session's debug adapter.
*
* @param callback The callback that is triggered when a custom event is received from the debug adapter.
* The debug session's ID.
*/
onCustomEvent
(
callback
:
(
event
:
any
)
=>
void
):
void
;
readonly
id
:
string
;
}
}
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
浏览文件 @
618fcaad
...
...
@@ -33,7 +33,8 @@ export class MainThreadDebugService extends MainThreadDebugServiceShape {
}));
this
.
_toDispose
.
push
(
debugService
.
onDidCustomEvent
(
event
=>
{
if
(
event
.
body
&&
event
.
body
.
sessionId
)
{
this
.
_proxy
.
$acceptDebugSessionCustomEvent
(
event
.
body
.
sessionId
,
event
);
const
process
=
this
.
debugService
.
findProcessByUUID
(
event
.
body
.
sessionId
);
// TODO
this
.
_proxy
.
$acceptDebugSessionCustomEvent
(
event
.
body
.
sessionId
,
process
.
configuration
.
type
,
process
.
configuration
.
name
,
event
);
}
}));
}
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
618fcaad
...
...
@@ -475,6 +475,9 @@ export function createApiFactory(
},
onDidChangeActiveDebugSession
:
proposedApiFunction
(
extension
,
(
listener
,
thisArg
?,
disposables
?)
=>
{
return
extHostDebugService
.
onDidChangeActiveDebugSession
(
listener
,
thisArg
,
disposables
);
}),
onDidReceiveDebugSessionCustomEvent
:
proposedApiFunction
(
extension
,
(
listener
,
thisArg
?,
disposables
?)
=>
{
return
extHostDebugService
.
onDidReceiveDebugSessionCustomEvent
(
listener
,
thisArg
,
disposables
);
})
};
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
618fcaad
...
...
@@ -503,7 +503,7 @@ export abstract class ExtHostTaskShape {
export
abstract
class
ExtHostDebugServiceShape
{
$acceptDebugSessionTerminated
(
id
:
DebugSessionUUID
,
type
:
string
,
name
:
string
):
void
{
throw
ni
();
}
$acceptDebugSessionActiveChanged
(
id
:
DebugSessionUUID
|
undefined
,
type
?:
string
,
name
?:
string
):
void
{
throw
ni
();
}
$acceptDebugSessionCustomEvent
(
id
:
DebugSessionUUID
,
event
:
any
):
void
{
throw
ni
();
}
$acceptDebugSessionCustomEvent
(
id
:
DebugSessionUUID
,
type
:
string
,
name
:
string
,
event
:
any
):
void
{
throw
ni
();
}
}
// --- proxy identifiers
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
618fcaad
...
...
@@ -27,11 +27,16 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
private
_activeDebugSession
:
ExtHostDebugSession
|
undefined
;
get
activeDebugSession
():
ExtHostDebugSession
|
undefined
{
return
this
.
_activeDebugSession
;
}
private
_onDidReceiveDebugSessionCustomEvent
:
Emitter
<
vscode
.
DebugSessionCustomEvent
>
;
get
onDidReceiveDebugSessionCustomEvent
():
Event
<
vscode
.
DebugSessionCustomEvent
>
{
return
this
.
_onDidReceiveDebugSessionCustomEvent
.
event
;
}
constructor
(
threadService
:
IThreadService
)
{
super
();
this
.
_onDidTerminateDebugSession
=
new
Emitter
<
vscode
.
DebugSession
>
();
this
.
_onDidChangeActiveDebugSession
=
new
Emitter
<
vscode
.
DebugSession
>
();
this
.
_onDidReceiveDebugSessionCustomEvent
=
new
Emitter
<
vscode
.
DebugSessionCustomEvent
>
();
this
.
_debugServiceProxy
=
threadService
.
get
(
MainContext
.
MainThreadDebugService
);
}
...
...
@@ -70,12 +75,19 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
this
.
_onDidChangeActiveDebugSession
.
fire
(
this
.
_activeDebugSession
);
}
public
$acceptDebugSessionCustomEvent
(
id
:
DebugSessionUUID
,
event
:
any
):
void
{
public
$acceptDebugSessionCustomEvent
(
id
:
DebugSessionUUID
,
type
:
string
,
name
:
string
,
event
:
any
):
void
{
let
debugSession
=
this
.
_debugSessions
.
get
(
id
);
if
(
debugSession
)
{
debugSession
.
_onCustomEvent
(
event
);
if
(
!
debugSession
)
{
debugSession
=
new
ExtHostDebugSession
(
this
.
_debugServiceProxy
,
id
,
type
,
name
);
this
.
_debugSessions
.
set
(
id
,
debugSession
);
}
const
ee
:
vscode
.
DebugSessionCustomEvent
=
{
session
:
debugSession
,
event
:
event
.
event
,
body
:
event
.
body
};
this
.
_onDidReceiveDebugSessionCustomEvent
.
fire
(
ee
);
}
}
...
...
@@ -88,8 +100,6 @@ export class ExtHostDebugSession implements vscode.DebugSession {
private
_type
:
string
;
private
_name
:
string
;
private
_onCustomEventCallback
:
(
event
:
any
)
=>
void
;
constructor
(
proxy
:
MainThreadDebugServiceShape
,
id
:
DebugSessionUUID
,
type
:
string
,
name
:
string
)
{
this
.
_debugServiceProxy
=
proxy
;
this
.
_id
=
id
;
...
...
@@ -112,12 +122,4 @@ export class ExtHostDebugSession implements vscode.DebugSession {
public
customRequest
(
command
:
string
,
args
:
any
):
Thenable
<
any
>
{
return
this
.
_debugServiceProxy
.
$customDebugAdapterRequest
(
this
.
_id
,
command
,
args
);
}
public
onCustomEvent
(
callback
:
(
event
:
any
)
=>
void
):
void
{
this
.
_onCustomEventCallback
=
callback
;
}
public
_onCustomEvent
(
event
:
any
):
void
{
this
.
_onCustomEventCallback
(
event
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录