Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3caba644
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,发现更多精彩内容 >>
提交
3caba644
编写于
7月 23, 2019
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move handshake to eh
上级
4cb14a33
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
43 addition
and
27 deletion
+43
-27
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+40
-7
src/vs/workbench/contrib/debug/browser/debugSession.ts
src/vs/workbench/contrib/debug/browser/debugSession.ts
+1
-3
src/vs/workbench/contrib/debug/browser/rawDebugSession.ts
src/vs/workbench/contrib/debug/browser/rawDebugSession.ts
+0
-15
src/vs/workbench/contrib/debug/test/browser/debugModel.test.ts
...s/workbench/contrib/debug/test/browser/debugModel.test.ts
+2
-2
未找到文件。
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
3caba644
...
...
@@ -34,6 +34,8 @@ import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
import
{
ExtensionDescriptionRegistry
}
from
'
vs/workbench/services/extensions/common/extensionDescriptionRegistry
'
;
import
{
IProcessEnvironment
}
from
'
vs/base/common/platform
'
;
import
{
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
SignService
}
from
'
vs/platform/sign/node/signService
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
class
ExtHostDebugService
implements
ExtHostDebugServiceShape
{
...
...
@@ -81,6 +83,8 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
private
_integratedTerminalInstance
?:
vscode
.
Terminal
;
private
_terminalDisposedListener
:
IDisposable
;
private
_signService
:
ISignService
;
constructor
(
mainContext
:
IMainContext
,
private
_workspaceService
:
IExtHostWorkspaceProvider
,
...
...
@@ -421,16 +425,45 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
this
.
_debugAdaptersTrackers
.
set
(
debugAdapterHandle
,
tracker
);
}
debugAdapter
.
onMessage
(
message
=>
{
debugAdapter
.
onMessage
(
async
message
=>
{
if
(
tracker
&&
tracker
.
onDidSendMessage
)
{
tracker
.
onDidSendMessage
(
message
);
}
if
(
message
.
type
===
'
request
'
&&
(
<
DebugProtocol
.
Request
>
message
).
command
===
'
handshake
'
)
{
const
request
=
<
DebugProtocol
.
Request
>
message
;
const
response
:
DebugProtocol
.
Response
=
{
type
:
'
response
'
,
seq
:
0
,
command
:
request
.
command
,
request_seq
:
request
.
seq
,
success
:
true
};
if
(
!
this
.
_signService
)
{
this
.
_signService
=
new
SignService
();
}
// DA -> VS Code
message
=
convertToVSCPaths
(
message
,
true
);
try
{
const
signature
=
await
this
.
_signService
.
sign
(
request
.
arguments
.
value
);
response
.
body
=
{
signature
:
signature
};
debugAdapter
.
sendResponse
(
response
);
}
catch
(
e
)
{
response
.
success
=
false
;
response
.
message
=
e
.
message
;
debugAdapter
.
sendResponse
(
response
);
}
}
else
{
if
(
tracker
&&
tracker
.
onDidSendMessage
)
{
tracker
.
onDidSendMessage
(
message
);
}
mythis
.
_debugServiceProxy
.
$acceptDAMessage
(
debugAdapterHandle
,
message
);
// DA -> VS Code
message
=
convertToVSCPaths
(
message
,
true
);
mythis
.
_debugServiceProxy
.
$acceptDAMessage
(
debugAdapterHandle
,
message
);
}
});
debugAdapter
.
onError
(
err
=>
{
if
(
tracker
&&
tracker
.
onError
)
{
...
...
src/vs/workbench/contrib/debug/browser/debugSession.ts
浏览文件 @
3caba644
...
...
@@ -31,7 +31,6 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import
{
ReplModel
}
from
'
vs/workbench/contrib/debug/common/replModel
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
export
class
DebugSession
implements
IDebugSession
{
...
...
@@ -66,7 +65,6 @@ export class DebugSession implements IDebugSession {
@
IViewletService
private
readonly
viewletService
:
IViewletService
,
@
IWorkspaceContextService
private
readonly
workspaceContextService
:
IWorkspaceContextService
,
@
INotificationService
private
readonly
notificationService
:
INotificationService
,
@
ISignService
private
readonly
signService
:
ISignService
,
@
IProductService
private
readonly
productService
:
IProductService
,
@
IWindowsService
private
readonly
windowsService
:
IWindowsService
)
{
...
...
@@ -169,7 +167,7 @@ export class DebugSession implements IDebugSession {
return
dbgr
.
createDebugAdapter
(
this
).
then
(
debugAdapter
=>
{
this
.
raw
=
new
RawDebugSession
(
debugAdapter
,
dbgr
,
this
.
telemetryService
,
customTelemetryService
,
this
.
signService
,
this
.
windowsService
);
this
.
raw
=
new
RawDebugSession
(
debugAdapter
,
dbgr
,
this
.
telemetryService
,
customTelemetryService
,
this
.
windowsService
);
return
this
.
raw
!
.
start
().
then
(()
=>
{
...
...
src/vs/workbench/contrib/debug/browser/rawDebugSession.ts
浏览文件 @
3caba644
...
...
@@ -12,7 +12,6 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
formatPII
,
isUri
}
from
'
vs/workbench/contrib/debug/common/debugUtils
'
;
import
{
IDebugAdapter
,
IConfig
,
AdapterEndEvent
,
IDebugger
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
createErrorWithActions
}
from
'
vs/base/common/errorsWithActions
'
;
import
{
ISignService
}
from
'
vs/platform/sign/common/sign
'
;
import
{
ParsedArgs
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
...
...
@@ -74,7 +73,6 @@ export class RawDebugSession {
dbgr
:
IDebugger
,
private
readonly
telemetryService
:
ITelemetryService
,
public
readonly
customTelemetryService
:
ITelemetryService
|
undefined
,
private
readonly
signService
:
ISignService
,
private
readonly
windowsService
:
IWindowsService
)
{
...
...
@@ -548,19 +546,6 @@ export class RawDebugSession {
safeSendResponse
(
response
);
});
break
;
case
'
handshake
'
:
try
{
const
signature
=
await
this
.
signService
.
sign
(
request
.
arguments
.
value
);
response
.
body
=
{
signature
:
signature
};
safeSendResponse
(
response
);
}
catch
(
e
)
{
response
.
success
=
false
;
response
.
message
=
e
.
message
;
safeSendResponse
(
response
);
}
break
;
default
:
response
.
success
=
false
;
response
.
message
=
`unknown request '
${
request
.
command
}
'`
;
...
...
src/vs/workbench/contrib/debug/test/browser/debugModel.test.ts
浏览文件 @
3caba644
...
...
@@ -15,7 +15,7 @@ import { ReplModel } from 'vs/workbench/contrib/debug/common/replModel';
import
{
IBreakpointUpdateData
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
function
createMockSession
(
model
:
DebugModel
,
name
=
'
mockSession
'
,
parentSession
?:
DebugSession
|
undefined
):
DebugSession
{
return
new
DebugSession
({
resolved
:
{
name
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
!
,
model
,
parentSession
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
);
return
new
DebugSession
({
resolved
:
{
name
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
!
,
model
,
parentSession
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
);
}
suite
(
'
Debug - Model
'
,
()
=>
{
...
...
@@ -427,7 +427,7 @@ suite('Debug - Model', () => {
// Repl output
test
(
'
repl output
'
,
()
=>
{
const
session
=
new
DebugSession
({
resolved
:
{
name
:
'
mockSession
'
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
!
,
model
,
undefined
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
);
const
session
=
new
DebugSession
({
resolved
:
{
name
:
'
mockSession
'
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
!
,
model
,
undefined
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
,
undefined
!
);
const
repl
=
new
ReplModel
(
session
);
repl
.
appendToRepl
(
'
first line
\n
'
,
severity
.
Error
);
repl
.
appendToRepl
(
'
second line
'
,
severity
.
Error
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录