Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
5eb21eaa
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
5eb21eaa
编写于
7月 06, 2017
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Debug API for tracking current debug session; fixes #30157
上级
78b912ee
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
66 addition
and
2 deletion
+66
-2
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+18
-0
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
.../workbench/api/electron-browser/mainThreadDebugService.ts
+8
-0
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+8
-1
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
+20
-0
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+1
-0
src/vs/workbench/parts/debug/common/debugViewModel.ts
src/vs/workbench/parts/debug/common/debugViewModel.ts
+10
-1
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
5eb21eaa
...
...
@@ -189,4 +189,22 @@ declare module 'vscode' {
*/
onData
(
callback
:
(
data
:
string
)
=>
any
):
void
;
}
export
namespace
debug
{
/**
* The currently active debug session or `undefined`. The active debug session is the one
* 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
const
activeDebugSession
:
DebugSession
|
undefined
;
/**
* An [event](#Event) which fires when the [active debug session](#debug.activeDebugSession)
* has changed. *Note* that the event also fires when the active debug session changes
* to `undefined`.
*/
export
const
onDidChangeActiveDebugSession
:
Event
<
DebugSession
|
undefined
>
;
}
}
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
浏览文件 @
5eb21eaa
...
...
@@ -20,9 +20,17 @@ export class MainThreadDebugService extends MainThreadDebugServiceShape {
@
IDebugService
private
debugService
:
IDebugService
)
{
super
();
this
.
_proxy
=
threadService
.
get
(
ExtHostContext
.
ExtHostDebugService
);
this
.
_toDispose
=
[];
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
)
{
this
.
_proxy
.
$acceptDebugSessionActiveChanged
(
<
DebugSessionUUID
>
proc
.
getId
(),
proc
.
configuration
.
type
,
proc
.
name
);
}
else
{
this
.
_proxy
.
$acceptDebugSessionActiveChanged
(
undefined
);
}
}));
}
public
dispose
():
void
{
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
5eb21eaa
...
...
@@ -463,12 +463,19 @@ export function createApiFactory(
// namespace: debug
const
debug
:
typeof
vscode
.
debug
=
{
get
activeDebugSession
()
{
assertProposedApi
(
extension
);
return
extHostDebugService
.
activeDebugSession
;
},
createDebugSession
(
config
:
vscode
.
DebugConfiguration
)
{
return
extHostDebugService
.
createDebugSession
(
config
);
},
onDidTerminateDebugSession
(
listener
,
thisArg
?,
disposables
?)
{
return
extHostDebugService
.
onDidTerminateDebugSession
(
listener
,
thisArg
,
disposables
);
}
},
onDidChangeActiveDebugSession
:
proposedApiFunction
(
extension
,
(
listener
,
thisArg
?,
disposables
?)
=>
{
return
extHostDebugService
.
onDidChangeActiveDebugSession
(
listener
,
thisArg
,
disposables
);
})
};
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
5eb21eaa
...
...
@@ -501,6 +501,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
();
}
}
// --- proxy identifiers
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
5eb21eaa
...
...
@@ -21,11 +21,18 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
private
_onDidTerminateDebugSession
:
Emitter
<
vscode
.
DebugSession
>
;
get
onDidTerminateDebugSession
():
Event
<
vscode
.
DebugSession
>
{
return
this
.
_onDidTerminateDebugSession
.
event
;
}
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
;
}
constructor
(
threadService
:
IThreadService
)
{
super
();
this
.
_onDidTerminateDebugSession
=
new
Emitter
<
vscode
.
DebugSession
>
();
this
.
_onDidChangeActiveDebugSession
=
new
Emitter
<
vscode
.
DebugSession
>
();
this
.
_debugServiceProxy
=
threadService
.
get
(
MainContext
.
MainThreadDebugService
);
}
...
...
@@ -47,6 +54,19 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
this
.
_onDidTerminateDebugSession
.
fire
(
debugSession
);
this
.
_debugSessions
.
delete
(
id
);
}
public
$acceptDebugSessionActiveChanged
(
id
:
DebugSessionUUID
|
undefined
,
type
?:
string
,
name
?:
string
):
void
{
if
(
id
)
{
this
.
_activeDebugSession
=
this
.
_debugSessions
.
get
(
id
);
if
(
!
this
.
_activeDebugSession
)
{
this
.
_activeDebugSession
=
new
ExtHostDebugSession
(
this
.
_debugServiceProxy
,
id
,
type
,
name
);
}
}
else
{
this
.
_activeDebugSession
=
undefined
;
}
this
.
_onDidChangeActiveDebugSession
.
fire
(
this
.
_activeDebugSession
);
}
}
export
class
ExtHostDebugSession
implements
vscode
.
DebugSession
{
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
5eb21eaa
...
...
@@ -273,6 +273,7 @@ export interface IViewModel extends ITreeElement {
isMultiProcessView
():
boolean
;
onDidFocusProcess
:
Event
<
IProcess
|
undefined
>
;
onDidFocusStackFrame
:
Event
<
IStackFrame
>
;
onDidSelectExpression
:
Event
<
IExpression
>
;
onDidSelectFunctionBreakpoint
:
Event
<
IFunctionBreakpoint
>
;
...
...
src/vs/workbench/parts/debug/common/debugViewModel.ts
浏览文件 @
5eb21eaa
...
...
@@ -12,6 +12,7 @@ export class ViewModel implements debug.IViewModel {
private
_focusedProcess
:
debug
.
IProcess
;
private
selectedExpression
:
debug
.
IExpression
;
private
selectedFunctionBreakpoint
:
debug
.
IFunctionBreakpoint
;
private
_onDidFocusProcess
:
Emitter
<
debug
.
IProcess
|
undefined
>
;
private
_onDidFocusStackFrame
:
Emitter
<
debug
.
IStackFrame
>
;
private
_onDidSelectExpression
:
Emitter
<
debug
.
IExpression
>
;
private
_onDidSelectFunctionBreakpoint
:
Emitter
<
debug
.
IFunctionBreakpoint
>
;
...
...
@@ -20,6 +21,7 @@ export class ViewModel implements debug.IViewModel {
public
changedWorkbenchViewState
:
boolean
;
constructor
(
private
_selectedConfigurationName
:
string
)
{
this
.
_onDidFocusProcess
=
new
Emitter
<
debug
.
IProcess
|
undefined
>
();
this
.
_onDidFocusStackFrame
=
new
Emitter
<
debug
.
IStackFrame
>
();
this
.
_onDidSelectExpression
=
new
Emitter
<
debug
.
IExpression
>
();
this
.
_onDidSelectFunctionBreakpoint
=
new
Emitter
<
debug
.
IFunctionBreakpoint
>
();
...
...
@@ -46,10 +48,17 @@ export class ViewModel implements debug.IViewModel {
public
setFocusedStackFrame
(
stackFrame
:
debug
.
IStackFrame
,
process
:
debug
.
IProcess
):
void
{
this
.
_focusedStackFrame
=
stackFrame
;
this
.
_focusedProcess
=
process
;
if
(
process
!==
this
.
_focusedProcess
)
{
this
.
_focusedProcess
=
process
;
this
.
_onDidFocusProcess
.
fire
(
process
);
}
this
.
_onDidFocusStackFrame
.
fire
(
stackFrame
);
}
public
get
onDidFocusProcess
():
Event
<
debug
.
IProcess
>
{
return
this
.
_onDidFocusProcess
.
event
;
}
public
get
onDidFocusStackFrame
():
Event
<
debug
.
IStackFrame
>
{
return
this
.
_onDidFocusStackFrame
.
event
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录