Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
0f489329
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,发现更多精彩内容 >>
提交
0f489329
编写于
9月 19, 2018
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
check debugServer property first; improved fix for #58847
上级
8d48055f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
48 addition
and
23 deletion
+48
-23
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+1
-1
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+27
-8
src/vs/workbench/parts/debug/node/debugger.ts
src/vs/workbench/parts/debug/node/debugger.ts
+20
-14
未找到文件。
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
0f489329
...
...
@@ -120,7 +120,7 @@ export function createApiFactory(
const
extHostFileSystemEvent
=
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostFileSystemEventService
,
new
ExtHostFileSystemEventService
(
rpcProtocol
,
extHostDocumentsAndEditors
));
const
extHostQuickOpen
=
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostQuickOpen
,
new
ExtHostQuickOpen
(
rpcProtocol
,
extHostWorkspace
,
extHostCommands
));
const
extHostTerminalService
=
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostTerminalService
,
new
ExtHostTerminalService
(
rpcProtocol
,
extHostConfiguration
,
extHostLogService
));
const
extHostDebugService
=
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostDebugService
,
new
ExtHostDebugService
(
rpcProtocol
,
extHostWorkspace
,
extensionService
,
extHostDocumentsAndEditors
,
extHostConfiguration
,
extHostTerminalService
));
const
extHostDebugService
=
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostDebugService
,
new
ExtHostDebugService
(
rpcProtocol
,
extHostWorkspace
,
extensionService
,
extHostDocumentsAndEditors
,
extHostConfiguration
,
extHostTerminalService
,
extHostCommands
));
const
extHostSCM
=
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostSCM
,
new
ExtHostSCM
(
rpcProtocol
,
extHostCommands
,
extHostLogService
));
const
extHostSearch
=
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostSearch
,
new
ExtHostSearch
(
rpcProtocol
,
schemeTransformer
));
const
extHostTask
=
rpcProtocol
.
set
(
ExtHostContext
.
ExtHostTask
,
new
ExtHostTask
(
rpcProtocol
,
extHostWorkspace
,
extHostDocumentsAndEditors
,
extHostConfiguration
));
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
0f489329
...
...
@@ -16,7 +16,7 @@ import {
IMainContext
,
IBreakpointsDeltaDto
,
ISourceMultiBreakpointDto
,
IFunctionBreakpointDto
,
IDebugSessionDto
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
Disposable
,
Position
,
Location
,
SourceBreakpoint
,
FunctionBreakpoint
,
DebugAdapterServer
}
from
'
vs/workbench/api/node/extHostTypes
'
;
import
{
Disposable
,
Position
,
Location
,
SourceBreakpoint
,
FunctionBreakpoint
,
DebugAdapterServer
,
DebugAdapterExecutable
}
from
'
vs/workbench/api/node/extHostTypes
'
;
import
{
generateUuid
}
from
'
vs/base/common/uuid
'
;
import
{
DebugAdapter
,
SocketDebugAdapter
}
from
'
vs/workbench/parts/debug/node/debugAdapter
'
;
import
{
ExtHostWorkspace
}
from
'
vs/workbench/api/node/extHostWorkspace
'
;
...
...
@@ -32,6 +32,7 @@ import { ExtHostTerminalService } from 'vs/workbench/api/node/extHostTerminalSer
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
ExtHostCommands
}
from
'
vs/workbench/api/node/extHostCommands
'
;
export
class
ExtHostDebugService
implements
ExtHostDebugServiceShape
{
...
...
@@ -66,6 +67,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
private
readonly
_onDidChangeBreakpoints
:
Emitter
<
vscode
.
BreakpointsChangeEvent
>
;
private
_aexCommands
:
Map
<
string
,
string
>
;
private
_debugAdapters
:
Map
<
number
,
IDebugAdapter
>
;
private
_variableResolver
:
IConfigurationResolverService
;
...
...
@@ -79,9 +81,10 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
private
_extensionService
:
ExtHostExtensionService
,
private
_editorsService
:
ExtHostDocumentsAndEditors
,
private
_configurationService
:
ExtHostConfiguration
,
private
_terminalService
:
ExtHostTerminalService
private
_terminalService
:
ExtHostTerminalService
,
private
_commandService
:
ExtHostCommands
)
{
this
.
_aexCommands
=
new
Map
();
this
.
_handleCounter
=
0
;
this
.
_providerByHandle
=
new
Map
();
this
.
_providerByType
=
new
Map
();
...
...
@@ -116,6 +119,9 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
// only debugger contributions with a "label" are considered a "main" debugger contribution
if
(
dbg
.
type
&&
dbg
.
label
)
{
debugTypes
.
push
(
dbg
.
type
);
if
(
dbg
.
adapterExecutableCommand
)
{
this
.
_aexCommands
.
set
(
dbg
.
type
,
dbg
.
adapterExecutableCommand
);
}
}
}
}
...
...
@@ -526,21 +532,34 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
// private & dto helpers
private
getAdapterDescriptor
(
debugConfigProvider
,
sessionDto
:
IDebugSessionDto
,
folderUri
:
UriComponents
|
undefined
,
config
:
vscode
.
DebugConfiguration
):
Thenable
<
vscode
.
DebugAdapterDescriptor
>
{
// a "debugServer" attribute in the launch config takes precedence
if
(
typeof
config
.
debugServer
===
'
number
'
)
{
return
TPromise
.
wrap
(
new
DebugAdapterServer
(
config
.
debugServer
));
}
if
(
debugConfigProvider
)
{
// try the proposed "provideDebugAdapter" API
if
(
debugConfigProvider
.
provideDebugAdapter
)
{
const
adapterExecutable
=
DebugAdapter
.
platformAdapterExecutable
(
this
.
_extensionService
.
getAllExtensionDescriptions
(),
config
.
type
);
return
asThenable
(()
=>
debugConfigProvider
.
provideDebugAdapter
(
this
.
getSession
(
sessionDto
),
this
.
getFolder
(
folderUri
),
adapterExecutable
,
config
,
CancellationToken
.
None
));
}
//
deprecated
//
try the deprecated "debugAdapterExecutable" API
if
(
debugConfigProvider
.
debugAdapterExecutable
)
{
return
asThenable
(()
=>
debugConfigProvider
.
debugAdapterExecutable
(
this
.
getFolder
(
folderUri
),
CancellationToken
.
None
));
}
}
// fallback: use serverport or executable information from package.json
// TODO@AW support legacy command based mechanism
if
(
typeof
config
.
debugServer
===
'
number
'
)
{
return
TPromise
.
wrap
(
new
DebugAdapterServer
(
config
.
debugServer
));
// try deprecated command based extension API "adapterExecutableCommand" to determine the executable
const
aex
=
this
.
_aexCommands
.
get
(
config
.
type
);
if
(
aex
)
{
const
rootFolder
=
folderUri
?
URI
.
revive
(
folderUri
).
toString
()
:
undefined
;
return
this
.
_commandService
.
executeCommand
(
aex
,
rootFolder
).
then
((
ae
:
{
command
:
string
,
args
:
string
[]
})
=>
{
return
new
DebugAdapterExecutable
(
ae
.
command
,
ae
.
args
||
[]);
});
}
// fallback: use executable information from package.json
return
TPromise
.
wrap
(
DebugAdapter
.
platformAdapterExecutable
(
this
.
_extensionService
.
getAllExtensionDescriptions
(),
config
.
type
));
}
...
...
src/vs/workbench/parts/debug/node/debugger.ts
浏览文件 @
0f489329
...
...
@@ -58,28 +58,34 @@ export class Debugger implements IDebugger {
private
getAdapterDescriptor
(
session
:
IDebugSession
,
root
:
IWorkspaceFolder
,
config
:
IConfig
):
TPromise
<
IAdapterDescriptor
>
{
// try deprecated command based extension API to receive an executable
if
(
this
.
debuggerContribution
.
adapterExecutableCommand
)
{
return
this
.
commandService
.
executeCommand
<
IAdapterExecutable
>
(
this
.
debuggerContribution
.
adapterExecutableCommand
,
root
?
root
.
uri
.
toString
()
:
undefined
).
then
(
ae
=>
{
return
<
IAdapterExecutable
>
{
type
:
'
executable
'
,
command
:
ae
.
command
,
args
:
ae
.
args
||
[]
};
// a "debugServer" attribute in the launch config takes precedence
if
(
typeof
config
.
debugServer
===
'
number
'
)
{
return
TPromise
.
wrap
(
<
IAdapterServer
>
{
type
:
'
server
'
,
port
:
config
.
debugServer
});
}
// try the proposed and the deprecated "provideDebugAdapter" API
return
this
.
configurationManager
.
provideDebugAdapter
(
session
,
root
?
root
.
uri
:
undefined
,
config
).
then
(
adapter
=>
{
if
(
adapter
)
{
return
adapter
;
}
if
(
typeof
config
.
debugServer
===
'
number
'
)
{
return
<
IAdapterServer
>
{
type
:
'
server
'
,
port
:
config
.
debugServer
};
// try deprecated command based extension API "adapterExecutableCommand" to determine the executable
if
(
this
.
debuggerContribution
.
adapterExecutableCommand
)
{
const
rootFolder
=
root
?
root
.
uri
.
toString
()
:
undefined
;
return
this
.
commandService
.
executeCommand
<
IAdapterExecutable
>
(
this
.
debuggerContribution
.
adapterExecutableCommand
,
rootFolder
).
then
((
ae
:
{
command
:
string
,
args
:
string
[]
})
=>
{
return
<
IAdapterDescriptor
>
{
type
:
'
executable
'
,
command
:
ae
.
command
,
args
:
ae
.
args
||
[]
};
});
}
// fallback: use information from package.json
// fallback: use executable information from package.json
return
DebugAdapter
.
platformAdapterExecutable
(
this
.
mergedExtensionDescriptions
,
this
.
type
);
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录