Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
254c8c5b
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,发现更多精彩内容 >>
提交
254c8c5b
编写于
7月 18, 2017
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug API: add onDidStartDebugSession
上级
81813b2c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
42 addition
and
0 deletion
+42
-0
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+5
-0
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
.../workbench/api/electron-browser/mainThreadDebugService.ts
+1
-0
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
-0
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+14
-0
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
+9
-0
src/vs/workbench/parts/debug/test/common/mockDebug.ts
src/vs/workbench/parts/debug/test/common/mockDebug.ts
+4
-0
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
254c8c5b
...
...
@@ -5483,6 +5483,11 @@ declare module 'vscode' {
*/
export
const
onDidChangeActiveDebugSession
:
Event
<
DebugSession
|
undefined
>
;
/**
* An [event](#Event) which fires when a new debug session has been started.
*/
export
const
onDidStartDebugSession
:
Event
<
DebugSession
>
;
/**
* An [event](#Event) which fires when a custom DAP event is received from the debug session.
*/
...
...
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
浏览文件 @
254c8c5b
...
...
@@ -23,6 +23,7 @@ export class MainThreadDebugService extends MainThreadDebugServiceShape {
this
.
_proxy
=
threadService
.
get
(
ExtHostContext
.
ExtHostDebugService
);
this
.
_toDispose
=
[];
this
.
_toDispose
.
push
(
debugService
.
onDidNewProcess
(
proc
=>
this
.
_proxy
.
$acceptDebugSessionStarted
(
<
DebugSessionUUID
>
proc
.
getId
(),
proc
.
configuration
.
type
,
proc
.
name
)));
this
.
_toDispose
.
push
(
debugService
.
onDidEndProcess
(
proc
=>
this
.
_proxy
.
$acceptDebugSessionTerminated
(
<
DebugSessionUUID
>
proc
.
getId
(),
proc
.
configuration
.
type
,
proc
.
name
)));
this
.
_toDispose
.
push
(
debugService
.
getViewModel
().
onDidFocusProcess
(
proc
=>
{
if
(
proc
)
{
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
254c8c5b
...
...
@@ -470,6 +470,9 @@ export function createApiFactory(
startDebugSession
(
config
:
vscode
.
DebugConfiguration
)
{
return
extHostDebugService
.
startDebugSession
(
config
);
},
onDidStartDebugSession
(
listener
,
thisArg
?,
disposables
?)
{
return
extHostDebugService
.
onDidStartDebugSession
(
listener
,
thisArg
,
disposables
);
},
onDidTerminateDebugSession
(
listener
,
thisArg
?,
disposables
?)
{
return
extHostDebugService
.
onDidTerminateDebugSession
(
listener
,
thisArg
,
disposables
);
},
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
254c8c5b
...
...
@@ -499,6 +499,7 @@ export abstract class ExtHostTaskShape {
}
export
abstract
class
ExtHostDebugServiceShape
{
$acceptDebugSessionStarted
(
id
:
DebugSessionUUID
,
type
:
string
,
name
:
string
):
void
{
throw
ni
();
}
$acceptDebugSessionTerminated
(
id
:
DebugSessionUUID
,
type
:
string
,
name
:
string
):
void
{
throw
ni
();
}
$acceptDebugSessionActiveChanged
(
id
:
DebugSessionUUID
|
undefined
,
type
?:
string
,
name
?:
string
):
void
{
throw
ni
();
}
$acceptDebugSessionCustomEvent
(
id
:
DebugSessionUUID
,
type
:
string
,
name
:
string
,
event
:
any
):
void
{
throw
ni
();
}
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
254c8c5b
...
...
@@ -18,6 +18,9 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
private
_debugServiceProxy
:
MainThreadDebugServiceShape
;
private
_debugSessions
:
Map
<
DebugSessionUUID
,
ExtHostDebugSession
>
=
new
Map
<
DebugSessionUUID
,
ExtHostDebugSession
>
();
private
_onDidStartDebugSession
:
Emitter
<
vscode
.
DebugSession
>
;
get
onDidStartDebugSession
():
Event
<
vscode
.
DebugSession
>
{
return
this
.
_onDidStartDebugSession
.
event
;
}
private
_onDidTerminateDebugSession
:
Emitter
<
vscode
.
DebugSession
>
;
get
onDidTerminateDebugSession
():
Event
<
vscode
.
DebugSession
>
{
return
this
.
_onDidTerminateDebugSession
.
event
;
}
...
...
@@ -34,6 +37,7 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
constructor
(
threadService
:
IThreadService
)
{
super
();
this
.
_onDidStartDebugSession
=
new
Emitter
<
vscode
.
DebugSession
>
();
this
.
_onDidTerminateDebugSession
=
new
Emitter
<
vscode
.
DebugSession
>
();
this
.
_onDidChangeActiveDebugSession
=
new
Emitter
<
vscode
.
DebugSession
>
();
this
.
_onDidReceiveDebugSessionCustomEvent
=
new
Emitter
<
vscode
.
DebugSessionCustomEvent
>
();
...
...
@@ -50,6 +54,16 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
});
}
public
$acceptDebugSessionStarted
(
id
:
DebugSessionUUID
,
type
:
string
,
name
:
string
):
void
{
let
debugSession
=
this
.
_debugSessions
.
get
(
id
);
if
(
!
debugSession
)
{
debugSession
=
new
ExtHostDebugSession
(
this
.
_debugServiceProxy
,
id
,
type
,
name
);
this
.
_debugSessions
.
set
(
id
,
debugSession
);
}
this
.
_onDidStartDebugSession
.
fire
(
debugSession
);
}
public
$acceptDebugSessionTerminated
(
id
:
DebugSessionUUID
,
type
:
string
,
name
:
string
):
void
{
let
debugSession
=
this
.
_debugSessions
.
get
(
id
);
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
254c8c5b
...
...
@@ -440,6 +440,11 @@ export interface IDebugService {
*/
onDidChangeState
:
Event
<
State
>
;
/**
* Allows to register on new process events.
*/
onDidNewProcess
:
Event
<
IProcess
>
;
/**
* Allows to register on end process events.
*/
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
254c8c5b
...
...
@@ -68,6 +68,7 @@ export class DebugService implements debug.IDebugService {
private
sessionStates
:
Map
<
string
,
debug
.
State
>
;
private
_onDidChangeState
:
Emitter
<
debug
.
State
>
;
private
_onDidNewProcess
:
Emitter
<
debug
.
IProcess
>
;
private
_onDidEndProcess
:
Emitter
<
debug
.
IProcess
>
;
private
_onDidCustomEvent
:
Emitter
<
DebugProtocol
.
Event
>
;
private
model
:
Model
;
...
...
@@ -110,6 +111,7 @@ export class DebugService implements debug.IDebugService {
this
.
toDisposeOnSessionEnd
=
new
Map
<
string
,
lifecycle
.
IDisposable
[]
>
();
this
.
breakpointsToSendOnResourceSaved
=
new
Set
<
string
>
();
this
.
_onDidChangeState
=
new
Emitter
<
debug
.
State
>
();
this
.
_onDidNewProcess
=
new
Emitter
<
debug
.
IProcess
>
();
this
.
_onDidEndProcess
=
new
Emitter
<
debug
.
IProcess
>
();
this
.
_onDidCustomEvent
=
new
Emitter
<
DebugProtocol
.
Event
>
();
this
.
sessionStates
=
new
Map
<
string
,
debug
.
State
>
();
...
...
@@ -291,7 +293,9 @@ export class DebugService implements debug.IDebugService {
}
private
registerSessionListeners
(
process
:
Process
,
session
:
RawDebugSession
):
void
{
this
.
toDisposeOnSessionEnd
.
get
(
session
.
getId
()).
push
(
session
);
this
.
toDisposeOnSessionEnd
.
get
(
session
.
getId
()).
push
(
session
.
onDidInitialize
(
event
=>
{
aria
.
status
(
nls
.
localize
(
'
debuggingStarted
'
,
"
Debugging started.
"
));
const
sendConfigurationDone
=
()
=>
{
...
...
@@ -503,6 +507,10 @@ export class DebugService implements debug.IDebugService {
return
this
.
_onDidChangeState
.
event
;
}
public
get
onDidNewProcess
():
Event
<
debug
.
IProcess
>
{
return
this
.
_onDidNewProcess
.
event
;
}
public
get
onDidEndProcess
():
Event
<
debug
.
IProcess
>
{
return
this
.
_onDidEndProcess
.
event
;
}
...
...
@@ -842,6 +850,7 @@ export class DebugService implements debug.IDebugService {
this
.
viewModel
.
setMultiProcessView
(
true
);
}
this
.
updateStateAndEmit
(
session
.
getId
(),
debug
.
State
.
Running
);
this
.
_onDidNewProcess
.
fire
(
process
);
return
this
.
telemetryService
.
publicLog
(
'
debugSessionStart
'
,
{
type
:
configuration
.
type
,
...
...
src/vs/workbench/parts/debug/test/common/mockDebug.ts
浏览文件 @
254c8c5b
...
...
@@ -19,6 +19,10 @@ export class MockDebugService implements debug.IDebugService {
return
null
;
}
public
get
onDidNewProcess
():
Event
<
debug
.
IProcess
>
{
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录