Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
fb204a36
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,发现更多精彩内容 >>
提交
fb204a36
编写于
9月 13, 2018
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improve error handling for socket DA
上级
4e59ab36
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
20 deletion
+36
-20
src/vs/workbench/parts/debug/node/debugAdapter.ts
src/vs/workbench/parts/debug/node/debugAdapter.ts
+36
-20
未找到文件。
src/vs/workbench/parts/debug/node/debugAdapter.ts
浏览文件 @
fb204a36
...
...
@@ -189,17 +189,6 @@ export abstract class StreamDebugAdapter extends AbstractDebugAdapter {
this
.
contentLength
=
-
1
;
readable
.
on
(
'
data
'
,
(
data
:
Buffer
)
=>
this
.
handleData
(
data
));
readable
.
on
(
'
close
'
,
()
=>
{
this
.
_onError
.
fire
(
new
Error
(
'
read error
'
));
});
readable
.
on
(
'
error
'
,
(
error
)
=>
{
this
.
_onError
.
fire
(
error
);
});
writable
.
on
(
'
error
'
,
(
error
)
=>
{
this
.
_onError
.
fire
(
error
);
});
}
public
sendMessage
(
message
:
DebugProtocol
.
ProtocolMessage
):
void
{
...
...
@@ -261,15 +250,27 @@ export class SocketDebugAdapter extends StreamDebugAdapter {
}
startSession
():
TPromise
<
void
>
{
return
new
TPromise
<
void
>
((
c
,
e
)
=>
{
return
new
TPromise
<
void
>
((
resolve
,
reject
)
=>
{
let
connected
=
false
;
this
.
socket
=
net
.
createConnection
(
this
.
port
,
this
.
host
,
()
=>
{
this
.
connect
(
this
.
socket
,
<
any
>
this
.
socket
);
c
(
null
);
this
.
connect
(
this
.
socket
,
this
.
socket
);
resolve
(
null
);
connected
=
true
;
});
this
.
socket
.
on
(
'
error
'
,
(
err
:
any
)
=>
{
e
(
err
);
this
.
socket
.
on
(
'
close
'
,
()
=>
{
if
(
connected
)
{
this
.
_onError
.
fire
(
new
Error
(
'
connection closed
'
));
}
else
{
reject
(
new
Error
(
'
connection closed
'
));
}
});
this
.
socket
.
on
(
'
error
'
,
error
=>
{
if
(
connected
)
{
this
.
_onError
.
fire
(
error
);
}
else
{
reject
(
error
);
}
});
this
.
socket
.
on
(
'
close
'
,
()
=>
this
.
_onExit
.
fire
(
0
));
});
}
...
...
@@ -343,8 +344,23 @@ export class DebugAdapter extends StreamDebugAdapter {
c
(
null
);
}
}).
then
(
_
=>
{
this
.
serverProcess
.
on
(
'
error
'
,
(
err
:
Error
)
=>
this
.
_onError
.
fire
(
err
));
this
.
serverProcess
.
on
(
'
exit
'
,
(
code
:
number
,
signal
:
string
)
=>
this
.
_onExit
.
fire
(
code
));
this
.
serverProcess
.
on
(
'
error
'
,
err
=>
{
this
.
_onError
.
fire
(
err
);
});
this
.
serverProcess
.
on
(
'
exit
'
,
(
code
,
signal
)
=>
{
this
.
_onExit
.
fire
(
code
);
});
this
.
serverProcess
.
stdout
.
on
(
'
close
'
,
()
=>
{
this
.
_onError
.
fire
(
new
Error
(
'
read error
'
));
});
this
.
serverProcess
.
stdout
.
on
(
'
error
'
,
error
=>
{
this
.
_onError
.
fire
(
error
);
});
this
.
serverProcess
.
stdin
.
on
(
'
error
'
,
error
=>
{
this
.
_onError
.
fire
(
error
);
});
if
(
this
.
outputService
)
{
const
sanitize
=
(
s
:
string
)
=>
s
.
toString
().
replace
(
/
\r?\n
$/mg
,
''
);
...
...
@@ -357,7 +373,7 @@ export class DebugAdapter extends StreamDebugAdapter {
}
this
.
connect
(
this
.
serverProcess
.
stdout
,
this
.
serverProcess
.
stdin
);
},
err
=>
{
},
(
err
:
Error
)
=>
{
this
.
_onError
.
fire
(
err
);
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录