Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1e9f594c
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,发现更多精彩内容 >>
提交
1e9f594c
编写于
1月 29, 2018
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
addressed review feedback
上级
81142e2c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
38 addition
and
33 deletion
+38
-33
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+2
-2
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
...parts/debug/electron-browser/debugConfigurationManager.ts
+2
-2
src/vs/workbench/parts/debug/node/debugAdapter.ts
src/vs/workbench/parts/debug/node/debugAdapter.ts
+23
-26
src/vs/workbench/parts/debug/test/node/debugAdapter.test.ts
src/vs/workbench/parts/debug/test/node/debugAdapter.test.ts
+10
-2
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
1e9f594c
...
...
@@ -365,13 +365,13 @@ declare module 'vscode' {
export
class
DebugAdapterExecutable
{
/**
* The command path of the debug adapter executable.
* A command must be
a either an absolute path or a
name of an executable looked up via the PATH environment variable.
* A command must be
either an absolute path or the
name of an executable looked up via the PATH environment variable.
* The special value 'node' will be mapped to VS Code's built-in node runtime.
*/
readonly
command
:
string
;
/**
* Optional arguments passed to the debug adapter.
* Optional arguments passed to the debug adapter
executable
.
*/
readonly
args
:
string
[];
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
1e9f594c
...
...
@@ -431,7 +431,7 @@ export interface IConfigurationManager {
unregisterDebugConfigurationProvider
(
handle
:
number
):
void
;
resolveConfigurationByProviders
(
folderUri
:
uri
|
undefined
,
type
:
string
|
undefined
,
debugConfiguration
:
any
):
TPromise
<
any
>
;
debugAdapterExecutable
(
folderUri
:
uri
|
undefined
,
type
:
string
):
TPromise
<
IAdapterExecutable
>
|
undefined
;
debugAdapterExecutable
(
folderUri
:
uri
|
undefined
,
type
:
string
):
TPromise
<
IAdapterExecutable
|
undefined
>
;
}
export
interface
ILaunch
{
...
...
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
浏览文件 @
1e9f594c
...
...
@@ -291,12 +291,12 @@ export class ConfigurationManager implements IConfigurationManager {
.
then
(
results
=>
results
.
reduce
((
first
,
second
)
=>
first
.
concat
(
second
),
[]));
}
public
debugAdapterExecutable
(
folderUri
:
uri
|
undefined
,
type
:
string
):
TPromise
<
IAdapterExecutable
>
|
undefined
{
public
debugAdapterExecutable
(
folderUri
:
uri
|
undefined
,
type
:
string
):
TPromise
<
IAdapterExecutable
|
undefined
>
{
const
providers
=
this
.
providers
.
filter
(
p
=>
p
.
type
===
type
&&
p
.
debugAdapterExecutable
);
if
(
providers
.
length
===
1
)
{
return
providers
[
0
].
debugAdapterExecutable
(
folderUri
);
}
return
undefined
;
return
TPromise
.
as
(
undefined
)
;
}
private
registerListeners
(
lifecycleService
:
ILifecycleService
):
void
{
...
...
src/vs/workbench/parts/debug/node/debugAdapter.ts
浏览文件 @
1e9f594c
...
...
@@ -33,35 +33,32 @@ export class Adapter {
public
getAdapterExecutable
(
root
:
IWorkspaceFolder
,
verifyAgainstFS
=
true
):
TPromise
<
IAdapterExecutable
>
{
// start with extension API
if
(
this
.
configurationManager
)
{
const
adapterExecutablePromise
=
this
.
configurationManager
.
debugAdapterExecutable
(
root
.
uri
,
this
.
rawAdapter
.
type
);
if
(
adapterExecutablePromise
)
{
return
adapterExecutablePromise
.
then
(
adapterExecutable
=>
{
return
this
.
verifyAdapterDetails
(
adapterExecutable
,
verifyAgainstFS
);
});
return
this
.
configurationManager
.
debugAdapterExecutable
(
root
?
root
.
uri
:
undefined
,
this
.
rawAdapter
.
type
).
then
(
adapterExecutable
=>
{
if
(
adapterExecutable
)
{
return
this
.
verifyAdapterDetails
(
adapterExecutable
,
verifyAgainstFS
);
}
}
// try deprecated command based extension API
if
(
this
.
rawAdapter
.
adapterExecutableCommand
&&
root
)
{
return
this
.
commandService
.
executeCommand
<
IAdapterExecutable
>
(
this
.
rawAdapter
.
adapterExecutableCommand
,
root
.
uri
.
toString
()).
then
(
ad
=>
{
return
this
.
verifyAdapterDetails
(
ad
,
verifyAgainstFS
);
});
}
// try deprecated command based extension API
if
(
this
.
rawAdapter
.
adapterExecutableCommand
&&
root
)
{
return
this
.
commandService
.
executeCommand
<
IAdapterExecutable
>
(
this
.
rawAdapter
.
adapterExecutableCommand
,
root
.
uri
.
toString
()).
then
(
ad
=>
{
return
this
.
verifyAdapterDetails
(
ad
,
verifyAgainstFS
);
});
}
// old style: executable contribution specified in package.json
const
adapterExecutable
=
<
IAdapterExecutable
>
{
command
:
this
.
getProgram
(),
args
:
this
.
getAttributeBasedOnPlatform
(
'
args
'
)
};
const
runtime
=
this
.
getRuntime
();
if
(
runtime
)
{
const
runtimeArgs
=
this
.
getAttributeBasedOnPlatform
(
'
runtimeArgs
'
);
adapterExecutable
.
args
=
(
runtimeArgs
||
[]).
concat
([
adapterExecutable
.
command
]).
concat
(
adapterExecutable
.
args
||
[]);
adapterExecutable
.
command
=
runtime
;
}
return
this
.
verifyAdapterDetails
(
adapterExecutable
,
verifyAgainstFS
);
// fallback: executable contribution specified in package.json
adapterExecutable
=
<
IAdapterExecutable
>
{
command
:
this
.
getProgram
(),
args
:
this
.
getAttributeBasedOnPlatform
(
'
args
'
)
};
const
runtime
=
this
.
getRuntime
();
if
(
runtime
)
{
const
runtimeArgs
=
this
.
getAttributeBasedOnPlatform
(
'
runtimeArgs
'
);
adapterExecutable
.
args
=
(
runtimeArgs
||
[]).
concat
([
adapterExecutable
.
command
]).
concat
(
adapterExecutable
.
args
||
[]);
adapterExecutable
.
command
=
runtime
;
}
return
this
.
verifyAdapterDetails
(
adapterExecutable
,
verifyAgainstFS
);
});
}
private
verifyAdapterDetails
(
details
:
IAdapterExecutable
,
verifyAgainstFS
:
boolean
):
TPromise
<
IAdapterExecutable
>
{
...
...
src/vs/workbench/parts/debug/test/node/debugAdapter.test.ts
浏览文件 @
1e9f594c
...
...
@@ -6,9 +6,12 @@
import
*
as
assert
from
'
assert
'
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
IRawAdapter
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IRawAdapter
,
IAdapterExecutable
,
IConfigurationManager
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
Adapter
}
from
'
vs/workbench/parts/debug/node/debugAdapter
'
;
import
{
TestConfigurationService
}
from
'
vs/platform/configuration/test/common/testConfigurationService
'
;
import
uri
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
suite
(
'
Debug - Adapter
'
,
()
=>
{
let
adapter
:
Adapter
;
...
...
@@ -41,9 +44,14 @@ suite('Debug - Adapter', () => {
}
]
};
const
configurationManager
=
{
debugAdapterExecutable
(
folderUri
:
uri
|
undefined
,
type
:
string
):
TPromise
<
IAdapterExecutable
|
undefined
>
{
return
TPromise
.
as
(
undefined
);
}
};
setup
(()
=>
{
adapter
=
new
Adapter
(
null
,
rawAdapter
,
{
extensionFolderPath
,
id
:
'
adapter
'
,
name
:
'
myAdapter
'
,
version
:
'
1.0.0
'
,
publisher
:
'
vscode
'
,
isBuiltin
:
false
,
engines
:
null
},
adapter
=
new
Adapter
(
<
IConfigurationManager
>
configurationManager
,
rawAdapter
,
{
extensionFolderPath
,
id
:
'
adapter
'
,
name
:
'
myAdapter
'
,
version
:
'
1.0.0
'
,
publisher
:
'
vscode
'
,
isBuiltin
:
false
,
engines
:
null
},
new
TestConfigurationService
(),
null
);
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录