Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
412a1074
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,发现更多精彩内容 >>
提交
412a1074
编写于
3月 19, 2019
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
moved mainThreadDebugService to browser
上级
eddda708
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
168 addition
and
166 deletion
+168
-166
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+1
-1
src/vs/workbench/api/browser/mainThreadDebugService.ts
src/vs/workbench/api/browser/mainThreadDebugService.ts
+1
-2
src/vs/workbench/api/electron-browser/extensionHost.contribution.ts
...kbench/api/electron-browser/extensionHost.contribution.ts
+1
-1
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+2
-1
src/vs/workbench/contrib/debug/common/abstractDebugAdapter.ts
...vs/workbench/contrib/debug/common/abstractDebugAdapter.ts
+161
-0
src/vs/workbench/contrib/debug/node/debugAdapter.ts
src/vs/workbench/contrib/debug/node/debugAdapter.ts
+2
-161
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
412a1074
...
...
@@ -55,6 +55,7 @@
"./vs/vscode.d.ts"
,
"./vs/vscode.proposed.d.ts"
,
"./vs/workbench/api/browser/viewsExtensionPoint.ts"
,
"./vs/workbench/api/browser/mainThreadDebugService.ts"
,
"./vs/workbench/api/common/extHostCustomers.ts"
,
"./vs/workbench/api/common/configurationExtensionPoint.ts"
,
"./vs/workbench/api/common/jsonValidationExtensionPoint.ts"
,
...
...
@@ -63,7 +64,6 @@
"./vs/workbench/api/electron-browser/mainThreadCommands.ts"
,
"./vs/workbench/api/electron-browser/mainThreadConfiguration.ts"
,
"./vs/workbench/api/electron-browser/mainThreadConsole.ts"
,
"./vs/workbench/api/electron-browser/mainThreadDebugService.ts"
,
"./vs/workbench/api/electron-browser/mainThreadDecorations.ts"
,
"./vs/workbench/api/electron-browser/mainThreadDiagnostics.ts"
,
"./vs/workbench/api/electron-browser/mainThreadDialogs.ts"
,
...
...
src/vs/workbench/api/
electron-
browser/mainThreadDebugService.ts
→
src/vs/workbench/api/browser/mainThreadDebugService.ts
浏览文件 @
412a1074
...
...
@@ -12,7 +12,7 @@ import {
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
'
vs/workbench/api/common/extHostCustomers
'
;
import
severity
from
'
vs/base/common/severity
'
;
import
{
AbstractDebugAdapter
}
from
'
vs/workbench/contrib/debug/
node/d
ebugAdapter
'
;
import
{
AbstractDebugAdapter
}
from
'
vs/workbench/contrib/debug/
common/abstractD
ebugAdapter
'
;
import
{
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
convertToVSCPaths
,
convertToDAPaths
}
from
'
vs/workbench/contrib/debug/common/debugUtils
'
;
...
...
@@ -150,7 +150,6 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
return
Promise
.
resolve
();
}
public
$registerDebugConfigurationProvider
(
debugType
:
string
,
hasProvide
:
boolean
,
hasResolve
:
boolean
,
hasProvideDebugAdapter
:
boolean
,
handle
:
number
):
Promise
<
void
>
{
const
provider
=
<
IDebugConfigurationProvider
>
{
...
...
src/vs/workbench/api/electron-browser/extensionHost.contribution.ts
浏览文件 @
412a1074
...
...
@@ -19,7 +19,7 @@ import './mainThreadClipboard';
import
'
./mainThreadCommands
'
;
import
'
./mainThreadConfiguration
'
;
import
'
./mainThreadConsole
'
;
import
'
./mainThreadDebugService
'
;
import
'
.
./browser
/mainThreadDebugService
'
;
import
'
./mainThreadDecorations
'
;
import
'
./mainThreadDiagnostics
'
;
import
'
./mainThreadDialogs
'
;
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
412a1074
...
...
@@ -15,7 +15,8 @@ import {
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
Disposable
,
Position
,
Location
,
SourceBreakpoint
,
FunctionBreakpoint
,
DebugAdapterServer
,
DebugAdapterExecutable
}
from
'
vs/workbench/api/node/extHostTypes
'
;
import
{
ExecutableDebugAdapter
,
SocketDebugAdapter
,
AbstractDebugAdapter
}
from
'
vs/workbench/contrib/debug/node/debugAdapter
'
;
import
{
ExecutableDebugAdapter
,
SocketDebugAdapter
}
from
'
vs/workbench/contrib/debug/node/debugAdapter
'
;
import
{
AbstractDebugAdapter
}
from
'
vs/workbench/contrib/debug/common/abstractDebugAdapter
'
;
import
{
IExtHostWorkspaceProvider
}
from
'
vs/workbench/api/node/extHostWorkspace
'
;
import
{
ExtHostExtensionService
}
from
'
vs/workbench/api/node/extHostExtensionService
'
;
import
{
ExtHostDocumentsAndEditors
}
from
'
vs/workbench/api/node/extHostDocumentsAndEditors
'
;
...
...
src/vs/workbench/contrib/debug/common/abstractDebugAdapter.ts
0 → 100644
浏览文件 @
412a1074
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
IDebugAdapter
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
/**
* Abstract implementation of the low level API for a debug adapter.
* Missing is how this API communicates with the debug adapter.
*/
export
abstract
class
AbstractDebugAdapter
implements
IDebugAdapter
{
private
sequence
:
number
;
private
pendingRequests
:
Map
<
number
,
(
e
:
DebugProtocol
.
Response
)
=>
void
>
;
private
requestCallback
:
(
request
:
DebugProtocol
.
Request
)
=>
void
;
private
eventCallback
:
(
request
:
DebugProtocol
.
Event
)
=>
void
;
private
messageCallback
:
(
message
:
DebugProtocol
.
ProtocolMessage
)
=>
void
;
protected
readonly
_onError
:
Emitter
<
Error
>
;
protected
readonly
_onExit
:
Emitter
<
number
|
null
>
;
constructor
()
{
this
.
sequence
=
1
;
this
.
pendingRequests
=
new
Map
();
this
.
_onError
=
new
Emitter
<
Error
>
();
this
.
_onExit
=
new
Emitter
<
number
>
();
}
abstract
startSession
():
Promise
<
void
>
;
abstract
stopSession
():
Promise
<
void
>
;
abstract
sendMessage
(
message
:
DebugProtocol
.
ProtocolMessage
):
void
;
get
onError
():
Event
<
Error
>
{
return
this
.
_onError
.
event
;
}
get
onExit
():
Event
<
number
|
null
>
{
return
this
.
_onExit
.
event
;
}
onMessage
(
callback
:
(
message
:
DebugProtocol
.
ProtocolMessage
)
=>
void
):
void
{
if
(
this
.
eventCallback
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Message' callback`
));
}
this
.
messageCallback
=
callback
;
}
onEvent
(
callback
:
(
event
:
DebugProtocol
.
Event
)
=>
void
):
void
{
if
(
this
.
eventCallback
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Event' callback`
));
}
this
.
eventCallback
=
callback
;
}
onRequest
(
callback
:
(
request
:
DebugProtocol
.
Request
)
=>
void
):
void
{
if
(
this
.
requestCallback
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Request' callback`
));
}
this
.
requestCallback
=
callback
;
}
sendResponse
(
response
:
DebugProtocol
.
Response
):
void
{
if
(
response
.
seq
>
0
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to send more than one response for command
${
response
.
command
}
`
));
}
else
{
this
.
internalSend
(
'
response
'
,
response
);
}
}
sendRequest
(
command
:
string
,
args
:
any
,
clb
:
(
result
:
DebugProtocol
.
Response
)
=>
void
,
timeout
?:
number
):
void
{
const
request
:
any
=
{
command
:
command
};
if
(
args
&&
Object
.
keys
(
args
).
length
>
0
)
{
request
.
arguments
=
args
;
}
this
.
internalSend
(
'
request
'
,
request
);
if
(
typeof
timeout
===
'
number
'
)
{
const
timer
=
setTimeout
(()
=>
{
clearTimeout
(
timer
);
const
clb
=
this
.
pendingRequests
.
get
(
request
.
seq
);
if
(
clb
)
{
this
.
pendingRequests
.
delete
(
request
.
seq
);
const
err
:
DebugProtocol
.
Response
=
{
type
:
'
response
'
,
seq
:
0
,
request_seq
:
request
.
seq
,
success
:
false
,
command
,
message
:
`timeout after
${
timeout
}
ms`
};
clb
(
err
);
}
},
timeout
);
}
if
(
clb
)
{
// store callback for this request
this
.
pendingRequests
.
set
(
request
.
seq
,
clb
);
}
}
acceptMessage
(
message
:
DebugProtocol
.
ProtocolMessage
):
void
{
if
(
this
.
messageCallback
)
{
this
.
messageCallback
(
message
);
}
else
{
switch
(
message
.
type
)
{
case
'
event
'
:
if
(
this
.
eventCallback
)
{
this
.
eventCallback
(
<
DebugProtocol
.
Event
>
message
);
}
break
;
case
'
request
'
:
if
(
this
.
requestCallback
)
{
this
.
requestCallback
(
<
DebugProtocol
.
Request
>
message
);
}
break
;
case
'
response
'
:
const
response
=
<
DebugProtocol
.
Response
>
message
;
const
clb
=
this
.
pendingRequests
.
get
(
response
.
request_seq
);
if
(
clb
)
{
this
.
pendingRequests
.
delete
(
response
.
request_seq
);
clb
(
response
);
}
break
;
}
}
}
private
internalSend
(
typ
:
'
request
'
|
'
response
'
|
'
event
'
,
message
:
DebugProtocol
.
ProtocolMessage
):
void
{
message
.
type
=
typ
;
message
.
seq
=
this
.
sequence
++
;
this
.
sendMessage
(
message
);
}
protected
cancelPending
()
{
const
pending
=
this
.
pendingRequests
;
this
.
pendingRequests
=
new
Map
();
setTimeout
(
_
=>
{
pending
.
forEach
((
callback
,
request_seq
)
=>
{
const
err
:
DebugProtocol
.
Response
=
{
type
:
'
response
'
,
seq
:
0
,
request_seq
,
success
:
false
,
command
:
'
canceled
'
,
message
:
'
canceled
'
};
callback
(
err
);
});
},
1000
);
}
dispose
():
void
{
this
.
cancelPending
();
}
}
src/vs/workbench/contrib/debug/node/debugAdapter.ts
浏览文件 @
412a1074
...
...
@@ -12,170 +12,11 @@ import * as path from 'vs/base/common/path';
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
*
as
objects
from
'
vs/base/common/objects
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
ExtensionsChannelId
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
IOutputService
}
from
'
vs/workbench/contrib/output/common/output
'
;
import
{
IDebugAdapter
,
IDebugAdapter
Executable
,
IDebuggerContribution
,
IPlatformSpecificAdapterContribution
,
IDebugAdapterServer
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IDebugAdapterExecutable
,
IDebuggerContribution
,
IPlatformSpecificAdapterContribution
,
IDebugAdapterServer
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
/**
* Abstract implementation of the low level API for a debug adapter.
* Missing is how this API communicates with the debug adapter.
*/
export
abstract
class
AbstractDebugAdapter
implements
IDebugAdapter
{
private
sequence
:
number
;
private
pendingRequests
:
Map
<
number
,
(
e
:
DebugProtocol
.
Response
)
=>
void
>
;
private
requestCallback
:
(
request
:
DebugProtocol
.
Request
)
=>
void
;
private
eventCallback
:
(
request
:
DebugProtocol
.
Event
)
=>
void
;
private
messageCallback
:
(
message
:
DebugProtocol
.
ProtocolMessage
)
=>
void
;
protected
readonly
_onError
:
Emitter
<
Error
>
;
protected
readonly
_onExit
:
Emitter
<
number
|
null
>
;
constructor
()
{
this
.
sequence
=
1
;
this
.
pendingRequests
=
new
Map
();
this
.
_onError
=
new
Emitter
<
Error
>
();
this
.
_onExit
=
new
Emitter
<
number
>
();
}
abstract
startSession
():
Promise
<
void
>
;
abstract
stopSession
():
Promise
<
void
>
;
abstract
sendMessage
(
message
:
DebugProtocol
.
ProtocolMessage
):
void
;
get
onError
():
Event
<
Error
>
{
return
this
.
_onError
.
event
;
}
get
onExit
():
Event
<
number
|
null
>
{
return
this
.
_onExit
.
event
;
}
onMessage
(
callback
:
(
message
:
DebugProtocol
.
ProtocolMessage
)
=>
void
):
void
{
if
(
this
.
eventCallback
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Message' callback`
));
}
this
.
messageCallback
=
callback
;
}
onEvent
(
callback
:
(
event
:
DebugProtocol
.
Event
)
=>
void
):
void
{
if
(
this
.
eventCallback
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Event' callback`
));
}
this
.
eventCallback
=
callback
;
}
onRequest
(
callback
:
(
request
:
DebugProtocol
.
Request
)
=>
void
):
void
{
if
(
this
.
requestCallback
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Request' callback`
));
}
this
.
requestCallback
=
callback
;
}
sendResponse
(
response
:
DebugProtocol
.
Response
):
void
{
if
(
response
.
seq
>
0
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to send more than one response for command
${
response
.
command
}
`
));
}
else
{
this
.
internalSend
(
'
response
'
,
response
);
}
}
sendRequest
(
command
:
string
,
args
:
any
,
clb
:
(
result
:
DebugProtocol
.
Response
)
=>
void
,
timeout
?:
number
):
void
{
const
request
:
any
=
{
command
:
command
};
if
(
args
&&
Object
.
keys
(
args
).
length
>
0
)
{
request
.
arguments
=
args
;
}
this
.
internalSend
(
'
request
'
,
request
);
if
(
typeof
timeout
===
'
number
'
)
{
const
timer
=
setTimeout
(()
=>
{
clearTimeout
(
timer
);
const
clb
=
this
.
pendingRequests
.
get
(
request
.
seq
);
if
(
clb
)
{
this
.
pendingRequests
.
delete
(
request
.
seq
);
const
err
:
DebugProtocol
.
Response
=
{
type
:
'
response
'
,
seq
:
0
,
request_seq
:
request
.
seq
,
success
:
false
,
command
,
message
:
`timeout after
${
timeout
}
ms`
};
clb
(
err
);
}
},
timeout
);
}
if
(
clb
)
{
// store callback for this request
this
.
pendingRequests
.
set
(
request
.
seq
,
clb
);
}
}
acceptMessage
(
message
:
DebugProtocol
.
ProtocolMessage
):
void
{
if
(
this
.
messageCallback
)
{
this
.
messageCallback
(
message
);
}
else
{
switch
(
message
.
type
)
{
case
'
event
'
:
if
(
this
.
eventCallback
)
{
this
.
eventCallback
(
<
DebugProtocol
.
Event
>
message
);
}
break
;
case
'
request
'
:
if
(
this
.
requestCallback
)
{
this
.
requestCallback
(
<
DebugProtocol
.
Request
>
message
);
}
break
;
case
'
response
'
:
const
response
=
<
DebugProtocol
.
Response
>
message
;
const
clb
=
this
.
pendingRequests
.
get
(
response
.
request_seq
);
if
(
clb
)
{
this
.
pendingRequests
.
delete
(
response
.
request_seq
);
clb
(
response
);
}
break
;
}
}
}
private
internalSend
(
typ
:
'
request
'
|
'
response
'
|
'
event
'
,
message
:
DebugProtocol
.
ProtocolMessage
):
void
{
message
.
type
=
typ
;
message
.
seq
=
this
.
sequence
++
;
this
.
sendMessage
(
message
);
}
protected
cancelPending
()
{
const
pending
=
this
.
pendingRequests
;
this
.
pendingRequests
=
new
Map
();
setTimeout
(
_
=>
{
pending
.
forEach
((
callback
,
request_seq
)
=>
{
const
err
:
DebugProtocol
.
Response
=
{
type
:
'
response
'
,
seq
:
0
,
request_seq
,
success
:
false
,
command
:
'
canceled
'
,
message
:
'
canceled
'
};
callback
(
err
);
});
},
1000
);
}
dispose
():
void
{
this
.
cancelPending
();
}
}
import
{
AbstractDebugAdapter
}
from
'
../common/abstractDebugAdapter
'
;
/**
* An implementation that communicates via two streams with the debug adapter.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录