Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
af809a59
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,发现更多精彩内容 >>
提交
af809a59
编写于
10月 24, 2017
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
API: expose debug console; fixes #36753
上级
fa4c5561
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
62 addition
and
2 deletion
+62
-2
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+27
-0
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
.../workbench/api/electron-browser/mainThreadDebugService.ts
+7
-0
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+4
-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
+23
-1
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
af809a59
...
...
@@ -190,4 +190,31 @@ declare module 'vscode' {
}
//#endregion
/**
* Represents the debug console.
*/
export
interface
DebugConsole
{
/**
* Append the given value to the debug console.
*
* @param value A string, falsy values will not be printed.
*/
append
(
value
:
string
):
void
;
/**
* Append the given value and a line feed character
* to the debug console.
*
* @param value A string, falsy values will be printed.
*/
appendLine
(
value
:
string
):
void
;
}
export
namespace
debug
{
/**
* The [debug console](#DebugConsole) singleton.
*/
export
let
console
:
DebugConsole
;
}
}
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
浏览文件 @
af809a59
...
...
@@ -11,6 +11,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ExtHostContext
,
ExtHostDebugServiceShape
,
MainThreadDebugServiceShape
,
DebugSessionUUID
,
MainContext
,
IExtHostContext
}
from
'
../node/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
'
vs/workbench/api/electron-browser/extHostCustomers
'
;
import
severity
from
'
vs/base/common/severity
'
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadDebugService
)
export
class
MainThreadDebugService
implements
MainThreadDebugServiceShape
{
...
...
@@ -93,4 +94,10 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape {
}
return
TPromise
.
wrapError
(
new
Error
(
'
debug session not found
'
));
}
public
$appendDebugConsole
(
value
:
string
):
TPromise
<
any
>
{
// Use warning as severity to get the orange color for messages coming from the debug extension
this
.
debugService
.
logToRepl
(
value
,
severity
.
Warning
);
return
TPromise
.
as
<
void
>
(
undefined
);
}
}
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
af809a59
...
...
@@ -489,6 +489,9 @@ export function createApiFactory(
get
activeDebugSession
()
{
return
extHostDebugService
.
activeDebugSession
;
},
get
console
()
{
return
extHostDebugService
.
debugConsole
;
},
startDebugging
(
folder
:
vscode
.
WorkspaceFolder
|
undefined
,
nameOrConfig
:
string
|
vscode
.
DebugConfiguration
)
{
return
extHostDebugService
.
startDebugging
(
folder
,
nameOrConfig
);
},
...
...
@@ -506,7 +509,7 @@ export function createApiFactory(
},
registerDebugConfigurationProvider
(
debugType
:
string
,
provider
:
vscode
.
DebugConfigurationProvider
)
{
return
extHostDebugService
.
registerDebugConfigurationProvider
(
debugType
,
provider
);
}
,
}
};
// namespace: credentials
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
af809a59
...
...
@@ -404,6 +404,7 @@ export interface MainThreadDebugServiceShape extends IDisposable {
$unregisterDebugConfigurationProvider
(
handle
:
number
):
TPromise
<
any
>
;
$startDebugging
(
folder
:
URI
|
undefined
,
nameOrConfig
:
string
|
vscode
.
DebugConfiguration
):
TPromise
<
boolean
>
;
$customDebugAdapterRequest
(
id
:
DebugSessionUUID
,
command
:
string
,
args
:
any
):
TPromise
<
any
>
;
$appendDebugConsole
(
value
:
string
):
TPromise
<
any
>
;
}
export
interface
MainThreadCredentialsShape
extends
IDisposable
{
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
af809a59
...
...
@@ -40,6 +40,9 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
private
_onDidReceiveDebugSessionCustomEvent
:
Emitter
<
vscode
.
DebugSessionCustomEvent
>
;
get
onDidReceiveDebugSessionCustomEvent
():
Event
<
vscode
.
DebugSessionCustomEvent
>
{
return
this
.
_onDidReceiveDebugSessionCustomEvent
.
event
;
}
private
_debugConsole
:
ExtHostDebugConsole
;
get
debugConsole
():
ExtHostDebugConsole
{
return
this
.
_debugConsole
;
}
constructor
(
mainContext
:
IMainContext
,
workspace
:
ExtHostWorkspace
)
{
...
...
@@ -54,6 +57,8 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
this
.
_onDidReceiveDebugSessionCustomEvent
=
new
Emitter
<
vscode
.
DebugSessionCustomEvent
>
();
this
.
_debugServiceProxy
=
mainContext
.
get
(
MainContext
.
MainThreadDebugService
);
this
.
_debugConsole
=
new
ExtHostDebugConsole
(
this
.
_debugServiceProxy
);
}
public
registerDebugConfigurationProvider
(
type
:
string
,
provider
:
vscode
.
DebugConfigurationProvider
):
vscode
.
Disposable
{
...
...
@@ -178,7 +183,7 @@ export class ExtHostDebugSession implements vscode.DebugSession {
this
.
_id
=
id
;
this
.
_type
=
type
;
this
.
_name
=
name
;
}
;
}
public
get
id
():
string
{
return
this
.
_id
;
...
...
@@ -196,3 +201,20 @@ export class ExtHostDebugSession implements vscode.DebugSession {
return
this
.
_debugServiceProxy
.
$customDebugAdapterRequest
(
this
.
_id
,
command
,
args
);
}
}
export
class
ExtHostDebugConsole
implements
vscode
.
DebugConsole
{
private
_debugServiceProxy
:
MainThreadDebugServiceShape
;
constructor
(
proxy
:
MainThreadDebugServiceShape
)
{
this
.
_debugServiceProxy
=
proxy
;
}
append
(
value
:
string
):
void
{
this
.
_debugServiceProxy
.
$appendDebugConsole
(
value
);
}
appendLine
(
value
:
string
):
void
{
this
.
append
(
value
+
'
\n
'
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录