Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
c3b31c04
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c3b31c04
编写于
4月 17, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: remove type and label from IDebuggerContribution
fixes #46550
上级
3bc224fb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
41 addition
and
44 deletion
+41
-44
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+2
-5
src/vs/workbench/parts/debug/node/debugAdapter.ts
src/vs/workbench/parts/debug/node/debugAdapter.ts
+39
-39
未找到文件。
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
c3b31c04
...
@@ -404,8 +404,6 @@ export interface IAdapterExecutable {
...
@@ -404,8 +404,6 @@ export interface IAdapterExecutable {
}
}
export
interface
IPlatformSpecificAdapterContribution
{
export
interface
IPlatformSpecificAdapterContribution
{
type
?:
string
;
// TODO: doesn't belong here
label
?:
string
;
// TODO: doesn't belong here
program
?:
string
;
program
?:
string
;
args
?:
string
[];
args
?:
string
[];
runtime
?:
string
;
runtime
?:
string
;
...
@@ -413,9 +411,8 @@ export interface IPlatformSpecificAdapterContribution {
...
@@ -413,9 +411,8 @@ export interface IPlatformSpecificAdapterContribution {
}
}
export
interface
IDebuggerContribution
extends
IPlatformSpecificAdapterContribution
{
export
interface
IDebuggerContribution
extends
IPlatformSpecificAdapterContribution
{
// type: string; // TODO: host from IPlatformSpecificAdapterContribution
type
?:
string
;
// label?: string; // TODO: host from IPlatformSpecificAdapterContribution
label
?:
string
;
// debug adapter executable
// debug adapter executable
adapterExecutableCommand
?:
string
;
adapterExecutableCommand
?:
string
;
win
?:
IPlatformSpecificAdapterContribution
;
win
?:
IPlatformSpecificAdapterContribution
;
...
...
src/vs/workbench/parts/debug/node/debugAdapter.ts
浏览文件 @
c3b31c04
...
@@ -16,14 +16,14 @@ import { Emitter, Event } from 'vs/base/common/event';
...
@@ -16,14 +16,14 @@ import { Emitter, Event } from 'vs/base/common/event';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ExtensionsChannelId
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
ExtensionsChannelId
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
IExtensionDescription
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IExtensionDescription
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
*
as
debug
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IOutputService
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
IOutputService
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
IDebugAdapter
,
IAdapterExecutable
,
IDebuggerContribution
,
IPlatformSpecificAdapterContribution
}
from
'
vs/workbench/parts/debug/common/debug
'
;
/**
/**
* Abstract implementation of the low level API for a debug adapter.
* Abstract implementation of the low level API for a debug adapter.
* Missing is how this API communicates with the debug adapter.
* Missing is how this API communicates with the debug adapter.
*/
*/
export
abstract
class
AbstractDebugAdapter
implements
debug
.
IDebugAdapter
{
export
abstract
class
AbstractDebugAdapter
implements
IDebugAdapter
{
private
sequence
:
number
;
private
sequence
:
number
;
private
pendingRequests
:
Map
<
number
,
(
e
:
DebugProtocol
.
Response
)
=>
void
>
;
private
pendingRequests
:
Map
<
number
,
(
e
:
DebugProtocol
.
Response
)
=>
void
>
;
...
@@ -57,14 +57,14 @@ export abstract class AbstractDebugAdapter implements debug.IDebugAdapter {
...
@@ -57,14 +57,14 @@ export abstract class AbstractDebugAdapter implements debug.IDebugAdapter {
return
this
.
_onExit
.
event
;
return
this
.
_onExit
.
event
;
}
}
public
onEvent
(
callback
:
(
event
:
DebugProtocol
.
Event
)
=>
void
)
{
public
onEvent
(
callback
:
(
event
:
DebugProtocol
.
Event
)
=>
void
)
:
void
{
if
(
this
.
eventCallback
)
{
if
(
this
.
eventCallback
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Event' callback`
));
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Event' callback`
));
}
}
this
.
eventCallback
=
callback
;
this
.
eventCallback
=
callback
;
}
}
public
onRequest
(
callback
:
(
request
:
DebugProtocol
.
Request
)
=>
void
)
{
public
onRequest
(
callback
:
(
request
:
DebugProtocol
.
Request
)
=>
void
)
:
void
{
if
(
this
.
requestCallback
)
{
if
(
this
.
requestCallback
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Request' callback`
));
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Request' callback`
));
}
}
...
@@ -96,7 +96,7 @@ export abstract class AbstractDebugAdapter implements debug.IDebugAdapter {
...
@@ -96,7 +96,7 @@ export abstract class AbstractDebugAdapter implements debug.IDebugAdapter {
}
}
}
}
public
acceptMessage
(
message
:
DebugProtocol
.
ProtocolMessage
)
{
public
acceptMessage
(
message
:
DebugProtocol
.
ProtocolMessage
)
:
void
{
switch
(
message
.
type
)
{
switch
(
message
.
type
)
{
case
'
event
'
:
case
'
event
'
:
if
(
this
.
eventCallback
)
{
if
(
this
.
eventCallback
)
{
...
@@ -219,7 +219,7 @@ export class DebugAdapter extends StreamDebugAdapter {
...
@@ -219,7 +219,7 @@ export class DebugAdapter extends StreamDebugAdapter {
private
_serverProcess
:
cp
.
ChildProcess
;
private
_serverProcess
:
cp
.
ChildProcess
;
constructor
(
private
_debugType
:
string
,
private
_adapterExecutable
:
debug
.
IAdapterExecutable
|
null
,
extensionDescriptions
:
IExtensionDescription
[],
private
_outputService
?:
IOutputService
)
{
constructor
(
private
_debugType
:
string
,
private
_adapterExecutable
:
IAdapterExecutable
|
null
,
extensionDescriptions
:
IExtensionDescription
[],
private
_outputService
?:
IOutputService
)
{
super
();
super
();
if
(
!
this
.
_adapterExecutable
)
{
if
(
!
this
.
_adapterExecutable
)
{
...
@@ -306,61 +306,61 @@ export class DebugAdapter extends StreamDebugAdapter {
...
@@ -306,61 +306,61 @@ export class DebugAdapter extends StreamDebugAdapter {
}
}
}
}
private
static
extract
(
dbg
:
debug
.
IDebuggerContribution
,
extensionFolderPath
:
string
)
{
private
static
extract
(
contribution
:
IDebuggerContribution
,
extensionFolderPath
:
string
):
IDebuggerContribution
{
if
(
!
dbg
)
{
if
(
!
contribution
)
{
return
undefined
;
return
undefined
;
}
}
let
x
:
debug
.
IDebuggerContribution
=
{};
let
result
:
IDebuggerContribution
=
{};
if
(
dbg
.
runtime
)
{
if
(
contribution
.
runtime
)
{
if
(
dbg
.
runtime
.
indexOf
(
'
./
'
)
===
0
)
{
// TODO
if
(
contribution
.
runtime
.
indexOf
(
'
./
'
)
===
0
)
{
// TODO
x
.
runtime
=
paths
.
join
(
extensionFolderPath
,
dbg
.
runtime
);
result
.
runtime
=
paths
.
join
(
extensionFolderPath
,
contribution
.
runtime
);
}
else
{
}
else
{
x
.
runtime
=
dbg
.
runtime
;
result
.
runtime
=
contribution
.
runtime
;
}
}
}
}
if
(
dbg
.
runtimeArgs
)
{
if
(
contribution
.
runtimeArgs
)
{
x
.
runtimeArgs
=
dbg
.
runtimeArgs
;
result
.
runtimeArgs
=
contribution
.
runtimeArgs
;
}
}
if
(
dbg
.
program
)
{
if
(
contribution
.
program
)
{
if
(
!
paths
.
isAbsolute
(
dbg
.
program
))
{
if
(
!
paths
.
isAbsolute
(
contribution
.
program
))
{
x
.
program
=
paths
.
join
(
extensionFolderPath
,
dbg
.
program
);
result
.
program
=
paths
.
join
(
extensionFolderPath
,
contribution
.
program
);
}
else
{
}
else
{
x
.
program
=
dbg
.
program
;
result
.
program
=
contribution
.
program
;
}
}
}
}
if
(
dbg
.
args
)
{
if
(
contribution
.
args
)
{
x
.
args
=
dbg
.
args
;
result
.
args
=
contribution
.
args
;
}
}
if
(
dbg
.
win
)
{
if
(
contribution
.
win
)
{
x
.
win
=
DebugAdapter
.
extract
(
dbg
.
win
,
extensionFolderPath
);
result
.
win
=
DebugAdapter
.
extract
(
contribution
.
win
,
extensionFolderPath
);
}
}
if
(
dbg
.
winx86
)
{
if
(
contribution
.
winx86
)
{
x
.
winx86
=
DebugAdapter
.
extract
(
dbg
.
winx86
,
extensionFolderPath
);
result
.
winx86
=
DebugAdapter
.
extract
(
contribution
.
winx86
,
extensionFolderPath
);
}
}
if
(
dbg
.
windows
)
{
if
(
contribution
.
windows
)
{
x
.
windows
=
DebugAdapter
.
extract
(
dbg
.
windows
,
extensionFolderPath
);
result
.
windows
=
DebugAdapter
.
extract
(
contribution
.
windows
,
extensionFolderPath
);
}
}
if
(
dbg
.
osx
)
{
if
(
contribution
.
osx
)
{
x
.
osx
=
DebugAdapter
.
extract
(
dbg
.
osx
,
extensionFolderPath
);
result
.
osx
=
DebugAdapter
.
extract
(
contribution
.
osx
,
extensionFolderPath
);
}
}
if
(
dbg
.
linux
)
{
if
(
contribution
.
linux
)
{
x
.
linux
=
DebugAdapter
.
extract
(
dbg
.
linux
,
extensionFolderPath
);
result
.
linux
=
DebugAdapter
.
extract
(
contribution
.
linux
,
extensionFolderPath
);
}
}
return
x
;
return
result
;
}
}
static
platformAdapterExecutable
(
extensionDescriptions
:
IExtensionDescription
[],
debugType
:
string
):
debug
.
IAdapterExecutable
{
static
platformAdapterExecutable
(
extensionDescriptions
:
IExtensionDescription
[],
debugType
:
string
):
IAdapterExecutable
{
let
result
:
debug
.
IDebuggerContribution
=
{};
let
result
:
IDebuggerContribution
=
{};
debugType
=
debugType
.
toLowerCase
();
debugType
=
debugType
.
toLowerCase
();
// merge all contributions into one
// merge all contributions into one
for
(
const
ed
of
extensionDescriptions
)
{
for
(
const
ed
of
extensionDescriptions
)
{
if
(
ed
.
contributes
)
{
if
(
ed
.
contributes
)
{
const
debuggers
=
<
debug
.
IDebuggerContribution
[]
>
ed
.
contributes
[
'
debuggers
'
];
const
debuggers
=
<
IDebuggerContribution
[]
>
ed
.
contributes
[
'
debuggers
'
];
if
(
debuggers
&&
debuggers
.
length
>
0
)
{
if
(
debuggers
&&
debuggers
.
length
>
0
)
{
const
dbgs
=
debuggers
.
filter
(
d
=>
strings
.
equalsIgnoreCase
(
d
.
type
,
debugType
));
const
dbgs
=
debuggers
.
filter
(
d
=>
strings
.
equalsIgnoreCase
(
d
.
type
,
debugType
));
for
(
const
dbg
of
dbgs
)
{
for
(
const
dbg
of
dbgs
)
{
...
@@ -376,7 +376,7 @@ export class DebugAdapter extends StreamDebugAdapter {
...
@@ -376,7 +376,7 @@ export class DebugAdapter extends StreamDebugAdapter {
}
}
// select the right platform
// select the right platform
let
platformInfo
:
debug
.
IPlatformSpecificAdapterContribution
;
let
platformInfo
:
IPlatformSpecificAdapterContribution
;
if
(
platform
.
isWindows
&&
!
process
.
env
.
hasOwnProperty
(
'
PROCESSOR_ARCHITEW6432
'
))
{
if
(
platform
.
isWindows
&&
!
process
.
env
.
hasOwnProperty
(
'
PROCESSOR_ARCHITEW6432
'
))
{
platformInfo
=
result
.
winx86
||
result
.
win
||
result
.
windows
;
platformInfo
=
result
.
winx86
||
result
.
win
||
result
.
windows
;
}
else
if
(
platform
.
isWindows
)
{
}
else
if
(
platform
.
isWindows
)
{
...
@@ -410,7 +410,7 @@ export class DebugAdapter extends StreamDebugAdapter {
...
@@ -410,7 +410,7 @@ export class DebugAdapter extends StreamDebugAdapter {
// path hooks helpers
// path hooks helpers
export
function
convertToDAPaths
(
msg
:
DebugProtocol
.
ProtocolMessage
,
fixSourcePaths
:
(
source
:
DebugProtocol
.
Source
)
=>
void
)
{
export
function
convertToDAPaths
(
msg
:
DebugProtocol
.
ProtocolMessage
,
fixSourcePaths
:
(
source
:
DebugProtocol
.
Source
)
=>
void
)
:
void
{
convertPaths
(
msg
,
(
toDA
:
boolean
,
source
:
DebugProtocol
.
Source
|
undefined
)
=>
{
convertPaths
(
msg
,
(
toDA
:
boolean
,
source
:
DebugProtocol
.
Source
|
undefined
)
=>
{
if
(
toDA
&&
source
)
{
if
(
toDA
&&
source
)
{
fixSourcePaths
(
source
);
fixSourcePaths
(
source
);
...
@@ -418,7 +418,7 @@ export function convertToDAPaths(msg: DebugProtocol.ProtocolMessage, fixSourcePa
...
@@ -418,7 +418,7 @@ export function convertToDAPaths(msg: DebugProtocol.ProtocolMessage, fixSourcePa
});
});
}
}
export
function
convertToVSCPaths
(
msg
:
DebugProtocol
.
ProtocolMessage
,
fixSourcePaths
:
(
source
:
DebugProtocol
.
Source
)
=>
void
)
{
export
function
convertToVSCPaths
(
msg
:
DebugProtocol
.
ProtocolMessage
,
fixSourcePaths
:
(
source
:
DebugProtocol
.
Source
)
=>
void
)
:
void
{
convertPaths
(
msg
,
(
toDA
:
boolean
,
source
:
DebugProtocol
.
Source
|
undefined
)
=>
{
convertPaths
(
msg
,
(
toDA
:
boolean
,
source
:
DebugProtocol
.
Source
|
undefined
)
=>
{
if
(
!
toDA
&&
source
)
{
if
(
!
toDA
&&
source
)
{
fixSourcePaths
(
source
);
fixSourcePaths
(
source
);
...
@@ -426,7 +426,7 @@ export function convertToVSCPaths(msg: DebugProtocol.ProtocolMessage, fixSourceP
...
@@ -426,7 +426,7 @@ export function convertToVSCPaths(msg: DebugProtocol.ProtocolMessage, fixSourceP
});
});
}
}
function
convertPaths
(
msg
:
DebugProtocol
.
ProtocolMessage
,
fixSourcePaths
:
(
toDA
:
boolean
,
source
:
DebugProtocol
.
Source
|
undefined
)
=>
void
)
{
function
convertPaths
(
msg
:
DebugProtocol
.
ProtocolMessage
,
fixSourcePaths
:
(
toDA
:
boolean
,
source
:
DebugProtocol
.
Source
|
undefined
)
=>
void
)
:
void
{
switch
(
msg
.
type
)
{
switch
(
msg
.
type
)
{
case
'
event
'
:
case
'
event
'
:
const
event
=
<
DebugProtocol
.
Event
>
msg
;
const
event
=
<
DebugProtocol
.
Event
>
msg
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录