Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
1291d9e8
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1291d9e8
编写于
7月 06, 2017
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
proposed debug api: add support for custom DAP events
上级
bf3ea73c
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
64 addition
and
2 deletion
+64
-2
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+10
-0
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
.../workbench/api/electron-browser/mainThreadDebugService.ts
+5
-0
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-0
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+21
-2
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+5
-0
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+10
-0
src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts
...workbench/parts/debug/electron-browser/rawDebugSession.ts
+8
-0
src/vs/workbench/parts/debug/test/common/mockDebug.ts
src/vs/workbench/parts/debug/test/common/mockDebug.ts
+4
-0
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
1291d9e8
...
...
@@ -207,4 +207,14 @@ declare module 'vscode' {
export
const
onDidChangeActiveDebugSession
:
Event
<
DebugSession
|
undefined
>
;
}
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.
*/
onCustomEvent
(
callback
:
(
event
:
any
)
=>
void
):
void
;
}
}
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
浏览文件 @
1291d9e8
...
...
@@ -31,6 +31,11 @@ export class MainThreadDebugService extends MainThreadDebugServiceShape {
this
.
_proxy
.
$acceptDebugSessionActiveChanged
(
undefined
);
}
}));
this
.
_toDispose
.
push
(
debugService
.
onDidCustomEvent
(
event
=>
{
if
(
event
.
body
&&
event
.
body
.
sessionId
)
{
this
.
_proxy
.
$acceptDebugSessionCustomEvent
(
event
.
body
.
sessionId
,
event
);
}
}));
}
public
dispose
():
void
{
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
1291d9e8
...
...
@@ -502,6 +502,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
();
}
}
// --- proxy identifiers
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
1291d9e8
...
...
@@ -24,8 +24,8 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
private
_onDidChangeActiveDebugSession
:
Emitter
<
vscode
.
DebugSession
|
undefined
>
;
get
onDidChangeActiveDebugSession
():
Event
<
vscode
.
DebugSession
|
undefined
>
{
return
this
.
_onDidChangeActiveDebugSession
.
event
;
}
private
_activeDebugSession
:
vscode
.
DebugSession
|
undefined
;
get
activeDebugSession
():
vscode
.
DebugSession
|
undefined
{
return
this
.
_activeDebugSession
;
}
private
_activeDebugSession
:
ExtHost
DebugSession
|
undefined
;
get
activeDebugSession
():
ExtHost
DebugSession
|
undefined
{
return
this
.
_activeDebugSession
;
}
constructor
(
threadService
:
IThreadService
)
{
super
();
...
...
@@ -50,6 +50,7 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
let
debugSession
=
this
.
_debugSessions
.
get
(
id
);
if
(
!
debugSession
)
{
debugSession
=
new
ExtHostDebugSession
(
this
.
_debugServiceProxy
,
id
,
type
,
name
);
this
.
_debugSessions
.
set
(
id
,
debugSession
);
}
this
.
_onDidTerminateDebugSession
.
fire
(
debugSession
);
this
.
_debugSessions
.
delete
(
id
);
...
...
@@ -61,12 +62,21 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
this
.
_activeDebugSession
=
this
.
_debugSessions
.
get
(
id
);
if
(
!
this
.
_activeDebugSession
)
{
this
.
_activeDebugSession
=
new
ExtHostDebugSession
(
this
.
_debugServiceProxy
,
id
,
type
,
name
);
this
.
_debugSessions
.
set
(
id
,
this
.
_activeDebugSession
);
}
}
else
{
this
.
_activeDebugSession
=
undefined
;
}
this
.
_onDidChangeActiveDebugSession
.
fire
(
this
.
_activeDebugSession
);
}
public
$acceptDebugSessionCustomEvent
(
id
:
DebugSessionUUID
,
event
:
any
):
void
{
let
debugSession
=
this
.
_debugSessions
.
get
(
id
);
if
(
debugSession
)
{
debugSession
.
_onCustomEvent
(
event
);
}
}
}
export
class
ExtHostDebugSession
implements
vscode
.
DebugSession
{
...
...
@@ -78,6 +88,7 @@ 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
;
...
...
@@ -97,4 +108,12 @@ 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
);
}
}
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
1291d9e8
...
...
@@ -445,6 +445,11 @@ export interface IDebugService {
*/
onDidEndProcess
:
Event
<
IProcess
>
;
/**
* Allows to register on custom DAP events.
*/
onDidCustomEvent
:
Event
<
DebugProtocol
.
Event
>
;
/**
* Gets the current configuration manager.
*/
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
1291d9e8
...
...
@@ -69,6 +69,7 @@ export class DebugService implements debug.IDebugService {
private
sessionStates
:
Map
<
string
,
debug
.
State
>
;
private
_onDidChangeState
:
Emitter
<
debug
.
State
>
;
private
_onDidEndProcess
:
Emitter
<
debug
.
IProcess
>
;
private
_onDidCustomEvent
:
Emitter
<
DebugProtocol
.
Event
>
;
private
model
:
Model
;
private
viewModel
:
ViewModel
;
private
configurationManager
:
ConfigurationManager
;
...
...
@@ -110,6 +111,7 @@ export class DebugService implements debug.IDebugService {
this
.
breakpointsToSendOnResourceSaved
=
new
Set
<
string
>
();
this
.
_onDidChangeState
=
new
Emitter
<
debug
.
State
>
();
this
.
_onDidEndProcess
=
new
Emitter
<
debug
.
IProcess
>
();
this
.
_onDidCustomEvent
=
new
Emitter
<
DebugProtocol
.
Event
>
();
this
.
sessionStates
=
new
Map
<
string
,
debug
.
State
>
();
this
.
configurationManager
=
this
.
instantiationService
.
createInstance
(
ConfigurationManager
);
...
...
@@ -414,6 +416,10 @@ export class DebugService implements debug.IDebugService {
this
.
onSessionEnd
(
session
);
}
}));
this
.
toDisposeOnSessionEnd
.
get
(
session
.
getId
()).
push
(
session
.
onDidCustomEvent
(
event
=>
{
this
.
_onDidCustomEvent
.
fire
(
event
);
}));
}
private
fetchThreads
(
session
:
RawDebugSession
):
TPromise
<
any
>
{
...
...
@@ -497,6 +503,10 @@ export class DebugService implements debug.IDebugService {
return
this
.
_onDidEndProcess
.
event
;
}
public
get
onDidCustomEvent
():
Event
<
DebugProtocol
.
Event
>
{
return
this
.
_onDidCustomEvent
.
event
;
}
private
updateStateAndEmit
(
sessionId
?:
string
,
newState
?:
debug
.
State
):
void
{
if
(
sessionId
)
{
if
(
newState
===
debug
.
State
.
Inactive
)
{
...
...
src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts
浏览文件 @
1291d9e8
...
...
@@ -62,6 +62,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
private
_onDidThread
:
Emitter
<
DebugProtocol
.
ThreadEvent
>
;
private
_onDidOutput
:
Emitter
<
DebugProtocol
.
OutputEvent
>
;
private
_onDidBreakpoint
:
Emitter
<
DebugProtocol
.
BreakpointEvent
>
;
private
_onDidCustomEvent
:
Emitter
<
DebugProtocol
.
Event
>
;
private
_onDidEvent
:
Emitter
<
DebugProtocol
.
Event
>
;
constructor
(
...
...
@@ -90,6 +91,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
this
.
_onDidThread
=
new
Emitter
<
DebugProtocol
.
ThreadEvent
>
();
this
.
_onDidOutput
=
new
Emitter
<
DebugProtocol
.
OutputEvent
>
();
this
.
_onDidBreakpoint
=
new
Emitter
<
DebugProtocol
.
BreakpointEvent
>
();
this
.
_onDidCustomEvent
=
new
Emitter
<
DebugProtocol
.
Event
>
();
this
.
_onDidEvent
=
new
Emitter
<
DebugProtocol
.
Event
>
();
}
...
...
@@ -125,6 +127,10 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
return
this
.
_onDidBreakpoint
.
event
;
}
public
get
onDidCustomEvent
():
Event
<
DebugProtocol
.
Event
>
{
return
this
.
_onDidCustomEvent
.
event
;
}
public
get
onDidEvent
():
Event
<
DebugProtocol
.
Event
>
{
return
this
.
_onDidEvent
.
event
;
}
...
...
@@ -209,6 +215,8 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
this
.
_onDidTerminateDebugee
.
fire
(
<
SessionTerminatedEvent
>
event
);
}
else
if
(
event
.
event
===
'
exit
'
)
{
this
.
_onDidExitAdapter
.
fire
(
<
SessionExitedEvent
>
event
);
}
else
{
this
.
_onDidCustomEvent
.
fire
(
event
);
}
this
.
_onDidEvent
.
fire
(
event
);
...
...
src/vs/workbench/parts/debug/test/common/mockDebug.ts
浏览文件 @
1291d9e8
...
...
@@ -15,6 +15,10 @@ export class MockDebugService implements debug.IDebugService {
return
null
;
}
public
get
onDidCustomEvent
():
Event
<
DebugProtocol
.
Event
>
{
return
null
;
}
public
get
onDidEndProcess
():
Event
<
debug
.
IProcess
>
{
return
null
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录