Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4285736f
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,发现更多精彩内容 >>
提交
4285736f
编写于
9月 12, 2019
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: support canceling requests
fixes #80374
上级
f6df256c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
29 addition
and
12 deletion
+29
-12
src/vs/workbench/api/browser/mainThreadDebugService.ts
src/vs/workbench/api/browser/mainThreadDebugService.ts
+0
-1
src/vs/workbench/contrib/debug/browser/rawDebugSession.ts
src/vs/workbench/contrib/debug/browser/rawDebugSession.ts
+19
-1
src/vs/workbench/contrib/debug/common/abstractDebugAdapter.ts
...vs/workbench/contrib/debug/common/abstractDebugAdapter.ts
+8
-4
src/vs/workbench/contrib/debug/common/debug.ts
src/vs/workbench/contrib/debug/common/debug.ts
+2
-0
src/vs/workbench/contrib/debug/node/debugAdapter.ts
src/vs/workbench/contrib/debug/node/debugAdapter.ts
+0
-6
未找到文件。
src/vs/workbench/api/browser/mainThreadDebugService.ts
浏览文件 @
4285736f
...
...
@@ -378,7 +378,6 @@ class ExtensionHostDebugAdapter extends AbstractDebugAdapter {
}
public
stopSession
():
Promise
<
void
>
{
this
.
cancelPending
();
return
Promise
.
resolve
(
this
.
_proxy
.
$stopDASession
(
this
.
_handle
));
}
}
src/vs/workbench/contrib/debug/browser/rawDebugSession.ts
浏览文件 @
4285736f
...
...
@@ -112,6 +112,8 @@ export class RawDebugSession implements IDisposable {
}
}));
this
.
toDispose
.
push
(
this
.
onDidContinued
(()
=>
this
.
cancelPendingRequests
()));
this
.
debugAdapter
.
onEvent
(
event
=>
{
switch
(
event
.
event
)
{
case
'
initialized
'
:
...
...
@@ -466,13 +468,16 @@ export class RawDebugSession implements IDisposable {
return
Promise
.
reject
(
new
Error
(
'
goto is not supported
'
));
}
cancel
(
args
:
DebugProtocol
.
CancelArguments
):
Promise
<
DebugProtocol
.
CancelResponse
>
{
return
this
.
send
(
'
cancel
'
,
args
);
}
custom
(
request
:
string
,
args
:
any
):
Promise
<
DebugProtocol
.
Response
>
{
return
this
.
send
(
request
,
args
);
}
//---- private
private
shutdown
(
error
?:
Error
,
restart
=
false
):
Promise
<
any
>
{
if
(
!
this
.
inShutdown
)
{
this
.
inShutdown
=
true
;
...
...
@@ -489,10 +494,23 @@ export class RawDebugSession implements IDisposable {
return
Promise
.
resolve
(
undefined
);
}
private
cancelPendingRequests
():
void
{
if
(
this
.
debugAdapter
)
{
if
(
this
.
capabilities
.
supportsCancelRequest
)
{
this
.
debugAdapter
.
getPendingRequestIds
().
forEach
(
requestId
=>
{
this
.
cancel
({
requestId
});
});
}
else
{
this
.
debugAdapter
.
cancelPendingRequests
();
}
}
}
private
stopAdapter
(
error
?:
Error
):
Promise
<
any
>
{
if
(
this
.
debugAdapter
)
{
const
da
=
this
.
debugAdapter
;
this
.
debugAdapter
=
null
;
this
.
cancelPendingRequests
();
return
da
.
stopSession
().
then
(
_
=>
{
this
.
debugAdapterStopped
=
true
;
this
.
fireAdapterExitEvent
(
error
);
...
...
src/vs/workbench/contrib/debug/common/abstractDebugAdapter.ts
浏览文件 @
4285736f
...
...
@@ -137,11 +137,10 @@ export abstract class AbstractDebugAdapter implements IDebugAdapter {
this
.
sendMessage
(
message
);
}
async
cancelPending
():
Promise
<
void
>
{
async
cancelPending
Requests
():
Promise
<
void
>
{
const
pending
=
new
Map
<
number
,
(
e
:
DebugProtocol
.
Response
)
=>
void
>
();
this
.
pendingRequests
.
forEach
((
value
,
key
)
=>
pending
.
set
(
key
,
value
));
this
.
pendingRequests
.
clear
();
await
timeout
(
1000
);
await
timeout
(
500
);
pending
.
forEach
((
callback
,
request_seq
)
=>
{
const
err
:
DebugProtocol
.
Response
=
{
type
:
'
response
'
,
...
...
@@ -152,10 +151,15 @@ export abstract class AbstractDebugAdapter implements IDebugAdapter {
message
:
'
canceled
'
};
callback
(
err
);
this
.
pendingRequests
.
delete
(
request_seq
);
});
}
getPendingRequestIds
():
number
[]
{
return
Array
.
from
(
this
.
pendingRequests
.
keys
());
}
dispose
():
void
{
this
.
cancelPending
();
// noop
}
}
src/vs/workbench/contrib/debug/common/debug.ts
浏览文件 @
4285736f
...
...
@@ -506,6 +506,8 @@ export interface IDebugAdapter extends IDisposable {
sendResponse
(
response
:
DebugProtocol
.
Response
):
void
;
sendRequest
(
command
:
string
,
args
:
any
,
clb
:
(
result
:
DebugProtocol
.
Response
)
=>
void
,
timeout
?:
number
):
void
;
stopSession
():
Promise
<
void
>
;
cancelPendingRequests
():
void
;
getPendingRequestIds
():
number
[];
}
export
interface
IDebugAdapterFactory
extends
ITerminalLauncher
{
...
...
src/vs/workbench/contrib/debug/node/debugAdapter.ts
浏览文件 @
4285736f
...
...
@@ -129,9 +129,6 @@ export class SocketDebugAdapter extends StreamDebugAdapter {
stopSession
():
Promise
<
void
>
{
// Cancel all sent promises on disconnect so debug trees are not left in a broken state #3666.
this
.
cancelPending
();
if
(
this
.
socket
)
{
this
.
socket
.
end
();
this
.
socket
=
undefined
;
...
...
@@ -254,9 +251,6 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter {
stopSession
():
Promise
<
void
>
{
// Cancel all sent promises on disconnect so debug trees are not left in a broken state #3666.
this
.
cancelPending
();
if
(
!
this
.
serverProcess
)
{
return
Promise
.
resolve
(
undefined
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录