Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ac88c617
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,发现更多精彩内容 >>
提交
ac88c617
编写于
6月 08, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix telemetry use in debug
上级
10ef24fb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
60 addition
and
58 deletion
+60
-58
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+57
-57
src/vs/workbench/parts/debug/node/rawDebugSession.ts
src/vs/workbench/parts/debug/node/rawDebugSession.ts
+3
-1
未找到文件。
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
ac88c617
...
...
@@ -555,75 +555,75 @@ export class DebugService implements debug.IDebugService {
private
doCreateSession
(
configuration
:
debug
.
IConfig
):
TPromise
<
any
>
{
this
.
setStateAndEmit
(
debug
.
State
.
Initializing
);
this
.
telemetryService
.
getTelemetryInfo
().
then
(
info
=>
{
return
this
.
telemetryService
.
getTelemetryInfo
().
then
(
info
=>
{
const
telemetryInfo
:
{
[
key
:
string
]:
string
}
=
Object
.
create
(
null
);
telemetryInfo
[
'
common.vscodemachineid
'
]
=
info
.
machineId
;
telemetryInfo
[
'
common.vscodesessionid
'
]
=
info
.
sessionId
;
return
telemetryInfo
;
}).
then
(
data
=>
{
let
{
aiKey
,
type
}
=
this
.
configurationManager
.
adapter
;
const
{
aiKey
,
type
}
=
this
.
configurationManager
.
adapter
;
this
.
telemetryAdapter
=
createAIAdapter
(
aiKey
,
type
,
data
);
});
this
.
session
=
this
.
instantiationService
.
createInstance
(
session
.
RawDebugSession
,
configuration
.
debugServer
,
this
.
configurationManager
.
adapter
,
this
.
telemetryAdapter
);
this
.
registerSessionListeners
();
return
this
.
session
.
initialize
({
adapterID
:
configuration
.
type
,
pathFormat
:
'
path
'
,
linesStartAt1
:
true
,
columnsStartAt1
:
true
}).
then
((
result
:
DebugProtocol
.
InitializeResponse
)
=>
{
if
(
!
this
.
session
)
{
return
TPromise
.
wrapError
(
new
Error
(
nls
.
localize
(
'
debugAdapterCrash
'
,
"
Debug adapter process has terminated unexpectedly
"
)));
}
this
.
session
=
this
.
instantiationService
.
createInstance
(
session
.
RawDebugSession
,
configuration
.
debugServer
,
this
.
configurationManager
.
adapter
,
this
.
telemetryAdapter
);
this
.
registerSessionListeners
();
return
this
.
session
.
initialize
({
adapterID
:
configuration
.
type
,
pathFormat
:
'
path
'
,
linesStartAt1
:
true
,
columnsStartAt1
:
true
}).
then
((
result
:
DebugProtocol
.
InitializeResponse
)
=>
{
if
(
!
this
.
session
)
{
return
TPromise
.
wrapError
(
new
Error
(
nls
.
localize
(
'
debugAdapterCrash
'
,
"
Debug adapter process has terminated unexpectedly
"
)));
}
this
.
model
.
setExceptionBreakpoints
(
this
.
session
.
configuration
.
capabilities
.
exceptionBreakpointFilters
);
return
configuration
.
request
===
'
attach
'
?
this
.
session
.
attach
(
configuration
)
:
this
.
session
.
launch
(
configuration
);
}).
then
((
result
:
DebugProtocol
.
Response
)
=>
{
if
(
configuration
.
internalConsoleOptions
===
'
openOnSessionStart
'
||
(
!
this
.
viewModel
.
changedWorkbenchViewState
&&
configuration
.
internalConsoleOptions
!==
'
neverOpen
'
))
{
this
.
panelService
.
openPanel
(
debug
.
REPL_ID
,
false
).
done
(
undefined
,
errors
.
onUnexpectedError
);
}
this
.
model
.
setExceptionBreakpoints
(
this
.
session
.
configuration
.
capabilities
.
exceptionBreakpointFilters
);
return
configuration
.
request
===
'
attach
'
?
this
.
session
.
attach
(
configuration
)
:
this
.
session
.
launch
(
configuration
);
}).
then
((
result
:
DebugProtocol
.
Response
)
=>
{
if
(
configuration
.
internalConsoleOptions
===
'
openOnSessionStart
'
||
(
!
this
.
viewModel
.
changedWorkbenchViewState
&&
configuration
.
internalConsoleOptions
!==
'
neverOpen
'
))
{
this
.
panelService
.
openPanel
(
debug
.
REPL_ID
,
false
).
done
(
undefined
,
errors
.
onUnexpectedError
);
}
if
(
!
this
.
viewModel
.
changedWorkbenchViewState
&&
!
this
.
partService
.
isSideBarHidden
())
{
// We only want to change the workbench view state on the first debug session #5738 and if the side bar is not hidden
this
.
viewModel
.
changedWorkbenchViewState
=
true
;
this
.
viewletService
.
openViewlet
(
debug
.
VIEWLET_ID
);
}
if
(
!
this
.
viewModel
.
changedWorkbenchViewState
&&
!
this
.
partService
.
isSideBarHidden
())
{
// We only want to change the workbench view state on the first debug session #5738 and if the side bar is not hidden
this
.
viewModel
.
changedWorkbenchViewState
=
true
;
this
.
viewletService
.
openViewlet
(
debug
.
VIEWLET_ID
);
}
// Do not change status bar to orange if we are just running without debug.
if
(
!
configuration
.
noDebug
)
{
this
.
partService
.
addClass
(
'
debugging
'
);
}
this
.
extensionService
.
activateByEvent
(
`onDebug:
${
configuration
.
type
}
`
).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
contextService
.
updateOptions
(
'
editor
'
,
{
glyphMargin
:
true
});
this
.
inDebugMode
.
set
(
true
);
this
.
lazyTransitionToRunningState
();
// Do not change status bar to orange if we are just running without debug.
if
(
!
configuration
.
noDebug
)
{
this
.
partService
.
addClass
(
'
debugging
'
);
}
this
.
extensionService
.
activateByEvent
(
`onDebug:
${
configuration
.
type
}
`
).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
contextService
.
updateOptions
(
'
editor
'
,
{
glyphMargin
:
true
});
this
.
inDebugMode
.
set
(
true
);
this
.
lazyTransitionToRunningState
();
this
.
telemetryService
.
publicLog
(
'
debugSessionStart
'
,
{
type
:
configuration
.
type
,
breakpointCount
:
this
.
model
.
getBreakpoints
().
length
,
exceptionBreakpoints
:
this
.
model
.
getExceptionBreakpoints
(),
watchExpressionsCount
:
this
.
model
.
getWatchExpressions
().
length
,
extensionName
:
`
${
this
.
configurationManager
.
adapter
.
extensionDescription
.
publisher
}
.
${
this
.
configurationManager
.
adapter
.
extensionDescription
.
name
}
`
,
isBuiltin
:
this
.
configurationManager
.
adapter
.
extensionDescription
.
isBuiltin
});
}).
then
(
undefined
,
(
error
:
any
)
=>
{
this
.
telemetryService
.
publicLog
(
'
debugMisconfiguration
'
,
{
type
:
configuration
?
configuration
.
type
:
undefined
});
this
.
setStateAndEmit
(
debug
.
State
.
Inactive
);
if
(
this
.
session
)
{
this
.
session
.
disconnect
();
}
// Show the repl if some error got logged there #5870
if
(
this
.
model
.
getReplElements
().
length
>
0
)
{
this
.
panelService
.
openPanel
(
debug
.
REPL_ID
,
false
).
done
(
undefined
,
errors
.
onUnexpectedError
);
}
this
.
telemetryService
.
publicLog
(
'
debugSessionStart
'
,
{
type
:
configuration
.
type
,
breakpointCount
:
this
.
model
.
getBreakpoints
().
length
,
exceptionBreakpoints
:
this
.
model
.
getExceptionBreakpoints
(),
watchExpressionsCount
:
this
.
model
.
getWatchExpressions
().
length
,
extensionName
:
`
${
this
.
configurationManager
.
adapter
.
extensionDescription
.
publisher
}
.
${
this
.
configurationManager
.
adapter
.
extensionDescription
.
name
}
`
,
isBuiltin
:
this
.
configurationManager
.
adapter
.
extensionDescription
.
isBuiltin
const
configureAction
=
this
.
instantiationService
.
createInstance
(
debugactions
.
ConfigureAction
,
debugactions
.
ConfigureAction
.
ID
,
debugactions
.
ConfigureAction
.
LABEL
);
const
actions
=
(
error
.
actions
&&
error
.
actions
.
length
)
?
error
.
actions
.
concat
([
configureAction
])
:
[
CloseAction
,
configureAction
];
return
TPromise
.
wrapError
(
errors
.
create
(
error
.
message
,
{
actions
}));
});
}).
then
(
undefined
,
(
error
:
any
)
=>
{
this
.
telemetryService
.
publicLog
(
'
debugMisconfiguration
'
,
{
type
:
configuration
?
configuration
.
type
:
undefined
});
this
.
setStateAndEmit
(
debug
.
State
.
Inactive
);
if
(
this
.
session
)
{
this
.
session
.
disconnect
();
}
// Show the repl if some error got logged there #5870
if
(
this
.
model
.
getReplElements
().
length
>
0
)
{
this
.
panelService
.
openPanel
(
debug
.
REPL_ID
,
false
).
done
(
undefined
,
errors
.
onUnexpectedError
);
}
const
configureAction
=
this
.
instantiationService
.
createInstance
(
debugactions
.
ConfigureAction
,
debugactions
.
ConfigureAction
.
ID
,
debugactions
.
ConfigureAction
.
LABEL
);
const
actions
=
(
error
.
actions
&&
error
.
actions
.
length
)
?
error
.
actions
.
concat
([
configureAction
])
:
[
CloseAction
,
configureAction
];
return
TPromise
.
wrapError
(
errors
.
create
(
error
.
message
,
{
actions
}));
});
}
...
...
src/vs/workbench/parts/debug/node/rawDebugSession.ts
浏览文件 @
ac88c617
...
...
@@ -146,7 +146,9 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
const
message
=
error
?
debug
.
formatPII
(
error
.
format
,
false
,
error
.
variables
)
:
errorResponse
.
message
;
if
(
error
&&
error
.
sendTelemetry
)
{
this
.
telemetryService
.
publicLog
(
'
debugProtocolErrorResponse
'
,
{
error
:
message
});
this
.
telemtryAdapter
.
log
(
'
debugProtocolErrorResponse
'
,
{
error
:
message
});
if
(
this
.
telemtryAdapter
)
{
this
.
telemtryAdapter
.
log
(
'
debugProtocolErrorResponse
'
,
{
error
:
message
});
}
}
if
(
error
&&
error
.
showUser
===
false
)
{
return
TPromise
.
as
(
null
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录