Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
f1404198
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,发现更多精彩内容 >>
提交
f1404198
编写于
3月 16, 2018
作者:
A
André Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
proposed logMessage API; fixes #45643
上级
8ae0b0cb
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
22 deletion
+39
-22
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+7
-0
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
.../workbench/api/electron-browser/mainThreadDebugService.ts
+6
-3
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+9
-7
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+8
-7
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+9
-5
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
f1404198
...
...
@@ -378,6 +378,13 @@ declare module 'vscode' {
debugAdapterExecutable
?(
folder
:
WorkspaceFolder
|
undefined
,
token
?:
CancellationToken
):
ProviderResult
<
DebugAdapterExecutable
>
;
}
export
interface
Breakpoint
{
/**
* An optional message that gets logged when this breakpoint is hit.
*/
readonly
logMessage
?:
string
;
}
//#endregion
//#region Rob, Matt: logging
...
...
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
浏览文件 @
f1404198
...
...
@@ -101,7 +101,8 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape {
lineNumber
:
l
.
line
+
1
,
column
:
l
.
character
>
0
?
l
.
character
+
1
:
0
,
condition
:
l
.
condition
,
hitCondition
:
l
.
hitCondition
hitCondition
:
l
.
hitCondition
,
logMessage
:
l
.
logMessage
}
);
this
.
debugService
.
addBreakpoints
(
uri
.
revive
(
dto
.
uri
),
rawbps
);
...
...
@@ -126,9 +127,10 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape {
type
:
'
function
'
,
id
:
fbp
.
getId
(),
enabled
:
fbp
.
enabled
,
functionName
:
fbp
.
name
,
condition
:
fbp
.
condition
,
hitCondition
:
fbp
.
hitCondition
,
/* condition: fbp.condition */
logMessage
:
fbp
.
logMessage
,
functionName
:
fbp
.
name
};
}
else
{
const
sbp
=
<
IBreakpoint
>
bp
;
...
...
@@ -138,6 +140,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape {
enabled
:
sbp
.
enabled
,
condition
:
sbp
.
condition
,
hitCondition
:
sbp
.
hitCondition
,
logMessage
:
sbp
.
logMessage
,
uri
:
sbp
.
uri
,
line
:
sbp
.
lineNumber
>
0
?
sbp
.
lineNumber
-
1
:
0
,
character
:
(
typeof
sbp
.
column
===
'
number
'
&&
sbp
.
column
>
0
)
?
sbp
.
column
-
1
:
0
,
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
f1404198
...
...
@@ -725,21 +725,22 @@ export interface ExtHostTaskShape {
$provideTasks
(
handle
:
number
):
TPromise
<
TaskSet
>
;
}
export
interface
I
Function
BreakpointDto
{
type
:
'
function
'
;
export
interface
IBreakpointDto
{
type
:
string
;
id
?:
string
;
enabled
:
boolean
;
condition
?:
string
;
hitCondition
?:
string
;
logMessage
?:
string
;
}
export
interface
IFunctionBreakpointDto
extends
IBreakpointDto
{
type
:
'
function
'
;
functionName
:
string
;
}
export
interface
ISourceBreakpointDto
{
export
interface
ISourceBreakpointDto
extends
IBreakpointDto
{
type
:
'
source
'
;
id
?:
string
;
enabled
:
boolean
;
condition
?:
string
;
hitCondition
?:
string
;
uri
:
UriComponents
;
line
:
number
;
character
:
number
;
...
...
@@ -759,6 +760,7 @@ export interface ISourceMultiBreakpointDto {
enabled
:
boolean
;
condition
?:
string
;
hitCondition
?:
string
;
logMessage
?:
string
;
line
:
number
;
character
:
number
;
}[];
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
f1404198
...
...
@@ -111,18 +111,15 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
if
(
!
this
.
_breakpoints
.
has
(
bpd
.
id
))
{
let
bp
:
vscode
.
Breakpoint
;
if
(
bpd
.
type
===
'
function
'
)
{
bp
=
new
FunctionBreakpoint
(
bpd
.
functionName
,
bpd
.
enabled
,
bpd
.
condition
,
bpd
.
hitCondition
);
bp
=
new
FunctionBreakpoint
(
bpd
.
functionName
,
bpd
.
enabled
,
bpd
.
condition
,
bpd
.
hitCondition
,
bpd
.
logMessage
);
}
else
{
const
uri
=
URI
.
revive
(
bpd
.
uri
);
bp
=
new
SourceBreakpoint
(
new
Location
(
uri
,
new
Position
(
bpd
.
line
,
bpd
.
character
)),
bpd
.
enabled
,
bpd
.
condition
,
bpd
.
hitCondition
);
bp
=
new
SourceBreakpoint
(
new
Location
(
uri
,
new
Position
(
bpd
.
line
,
bpd
.
character
)),
bpd
.
enabled
,
bpd
.
condition
,
bpd
.
hitCondition
,
bpd
.
logMessage
);
}
bp
[
'
_id
'
]
=
bpd
.
id
;
this
.
_breakpoints
.
set
(
bpd
.
id
,
bp
);
a
.
push
(
bp
);
}
}
}
...
...
@@ -145,12 +142,14 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
fbp
.
enabled
=
bpd
.
enabled
;
fbp
.
condition
=
bpd
.
condition
;
fbp
.
hitCondition
=
bpd
.
hitCondition
;
fbp
.
logMessage
=
bpd
.
logMessage
;
fbp
.
functionName
=
bpd
.
functionName
;
}
else
if
(
bp
instanceof
SourceBreakpoint
&&
bpd
.
type
===
'
source
'
)
{
const
sbp
=
<
any
>
bp
;
sbp
.
enabled
=
bpd
.
enabled
;
sbp
.
condition
=
bpd
.
condition
;
sbp
.
hitCondition
=
bpd
.
hitCondition
;
sbp
.
logMessage
=
bpd
.
logMessage
;
sbp
.
location
=
new
Location
(
URI
.
revive
(
bpd
.
uri
),
new
Position
(
bpd
.
line
,
bpd
.
character
));
}
c
.
push
(
bp
);
...
...
@@ -206,6 +205,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
enabled
:
bp
.
enabled
,
condition
:
bp
.
condition
,
hitCondition
:
bp
.
hitCondition
,
logMessage
:
bp
.
logMessage
,
line
:
bp
.
location
.
range
.
start
.
line
,
character
:
bp
.
location
.
range
.
start
.
character
});
...
...
@@ -214,9 +214,10 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
type
:
'
function
'
,
id
:
bp
[
'
_id
'
],
enabled
:
bp
.
enabled
,
functionName
:
bp
.
functionName
,
hitCondition
:
bp
.
hitCondition
,
condition
:
bp
.
condition
logMessage
:
bp
.
logMessage
,
condition
:
bp
.
condition
,
functionName
:
bp
.
functionName
});
}
}
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
f1404198
...
...
@@ -1673,8 +1673,9 @@ export class Breakpoint {
readonly
enabled
:
boolean
;
readonly
condition
?:
string
;
readonly
hitCondition
?:
string
;
readonly
logMessage
?:
string
;
protected
constructor
(
enabled
?:
boolean
,
condition
?:
string
,
hitCondition
?:
string
)
{
protected
constructor
(
enabled
?:
boolean
,
condition
?:
string
,
hitCondition
?:
string
,
logMessage
?:
string
)
{
this
.
enabled
=
typeof
enabled
===
'
boolean
'
?
enabled
:
true
;
if
(
typeof
condition
===
'
string
'
)
{
this
.
condition
=
condition
;
...
...
@@ -1682,14 +1683,17 @@ export class Breakpoint {
if
(
typeof
hitCondition
===
'
string
'
)
{
this
.
hitCondition
=
hitCondition
;
}
if
(
typeof
logMessage
===
'
string
'
)
{
this
.
logMessage
=
logMessage
;
}
}
}
export
class
SourceBreakpoint
extends
Breakpoint
{
readonly
location
:
Location
;
constructor
(
location
:
Location
,
enabled
?:
boolean
,
condition
?:
string
,
hitCondition
?:
string
)
{
super
(
enabled
,
condition
,
hitCondition
);
constructor
(
location
:
Location
,
enabled
?:
boolean
,
condition
?:
string
,
hitCondition
?:
string
,
logMessage
?:
string
)
{
super
(
enabled
,
condition
,
hitCondition
,
logMessage
);
if
(
location
===
null
)
{
throw
illegalArgument
(
'
location
'
);
}
...
...
@@ -1700,8 +1704,8 @@ export class SourceBreakpoint extends Breakpoint {
export
class
FunctionBreakpoint
extends
Breakpoint
{
readonly
functionName
:
string
;
constructor
(
functionName
:
string
,
enabled
?:
boolean
,
condition
?:
string
,
hitCondition
?:
string
)
{
super
(
enabled
,
condition
,
hitCondition
);
constructor
(
functionName
:
string
,
enabled
?:
boolean
,
condition
?:
string
,
hitCondition
?:
string
,
logMessage
?:
string
)
{
super
(
enabled
,
condition
,
hitCondition
,
logMessage
);
if
(
!
functionName
)
{
throw
illegalArgument
(
'
functionName
'
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录