Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9af6cea0
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,发现更多精彩内容 >>
提交
9af6cea0
编写于
5月 21, 2019
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove support for running DA in renderer
上级
b513141f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
142 deletion
+11
-142
src/vs/workbench/api/browser/mainThreadDebugService.ts
src/vs/workbench/api/browser/mainThreadDebugService.ts
+1
-21
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+0
-2
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+0
-3
src/vs/workbench/contrib/debug/common/debug.ts
src/vs/workbench/contrib/debug/common/debug.ts
+0
-4
src/vs/workbench/contrib/debug/electron-browser/debugConfigurationManager.ts
...ntrib/debug/electron-browser/debugConfigurationManager.ts
+1
-28
src/vs/workbench/contrib/debug/node/debugger.ts
src/vs/workbench/contrib/debug/node/debugger.ts
+8
-83
src/vs/workbench/contrib/debug/test/node/debugger.test.ts
src/vs/workbench/contrib/debug/test/node/debugger.test.ts
+1
-1
未找到文件。
src/vs/workbench/api/browser/mainThreadDebugService.ts
浏览文件 @
9af6cea0
...
...
@@ -5,7 +5,7 @@
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
URI
as
uri
}
from
'
vs/base/common/uri
'
;
import
{
IDebugService
,
IConfig
,
IDebugConfigurationProvider
,
IBreakpoint
,
IFunctionBreakpoint
,
IBreakpointData
,
ITerminalSettings
,
IDebugAdapter
,
IDebugAdapterDescriptorFactory
,
IDebugSession
,
IDebugAdapterFactory
,
IDebugAdapterTrackerFactory
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IDebugService
,
IConfig
,
IDebugConfigurationProvider
,
IBreakpoint
,
IFunctionBreakpoint
,
IBreakpointData
,
ITerminalSettings
,
IDebugAdapter
,
IDebugAdapterDescriptorFactory
,
IDebugSession
,
IDebugAdapterFactory
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
ExtHostContext
,
ExtHostDebugServiceShape
,
MainThreadDebugServiceShape
,
DebugSessionUUID
,
MainContext
,
IExtHostContext
,
IBreakpointsDeltaDto
,
ISourceMultiBreakpointDto
,
ISourceBreakpointDto
,
IFunctionBreakpointDto
,
IDebugSessionDto
...
...
@@ -26,7 +26,6 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
private
_debugAdaptersHandleCounter
=
1
;
private
readonly
_debugConfigurationProviders
:
Map
<
number
,
IDebugConfigurationProvider
>
;
private
readonly
_debugAdapterDescriptorFactories
:
Map
<
number
,
IDebugAdapterDescriptorFactory
>
;
private
readonly
_debugAdapterTrackerFactories
:
Map
<
number
,
IDebugAdapterTrackerFactory
>
;
private
readonly
_sessions
:
Set
<
DebugSessionUUID
>
;
constructor
(
...
...
@@ -53,7 +52,6 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
this
.
_debugAdapters
=
new
Map
();
this
.
_debugConfigurationProviders
=
new
Map
();
this
.
_debugAdapterDescriptorFactories
=
new
Map
();
this
.
_debugAdapterTrackerFactories
=
new
Map
();
this
.
_sessions
=
new
Set
();
}
...
...
@@ -207,24 +205,6 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
}
}
public
$registerDebugAdapterTrackerFactory
(
debugType
:
string
,
handle
:
number
)
{
const
factory
=
<
IDebugAdapterTrackerFactory
>
{
type
:
debugType
,
};
this
.
_debugAdapterTrackerFactories
.
set
(
handle
,
factory
);
this
.
_toDispose
.
push
(
this
.
debugService
.
getConfigurationManager
().
registerDebugAdapterTrackerFactory
(
factory
));
return
Promise
.
resolve
(
undefined
);
}
public
$unregisterDebugAdapterTrackerFactory
(
handle
:
number
)
{
const
factory
=
this
.
_debugAdapterTrackerFactories
.
get
(
handle
);
if
(
factory
)
{
this
.
_debugAdapterTrackerFactories
.
delete
(
handle
);
this
.
debugService
.
getConfigurationManager
().
unregisterDebugAdapterTrackerFactory
(
factory
);
}
}
private
getSession
(
sessionId
:
DebugSessionUUID
|
undefined
):
IDebugSession
|
undefined
{
if
(
sessionId
)
{
return
this
.
debugService
.
getModel
().
getSession
(
sessionId
,
true
);
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
9af6cea0
...
...
@@ -683,10 +683,8 @@ export interface MainThreadDebugServiceShape extends IDisposable {
$acceptDAExit
(
handle
:
number
,
code
:
number
|
undefined
,
signal
:
string
|
undefined
):
void
;
$registerDebugConfigurationProvider
(
type
:
string
,
hasProvideMethod
:
boolean
,
hasResolveMethod
:
boolean
,
hasProvideDaMethod
:
boolean
,
handle
:
number
):
Promise
<
void
>
;
$registerDebugAdapterDescriptorFactory
(
type
:
string
,
handle
:
number
):
Promise
<
void
>
;
$registerDebugAdapterTrackerFactory
(
type
:
string
,
handle
:
number
):
Promise
<
any
>
;
$unregisterDebugConfigurationProvider
(
handle
:
number
):
void
;
$unregisterDebugAdapterDescriptorFactory
(
handle
:
number
):
void
;
$unregisterDebugAdapterTrackerFactory
(
handle
:
number
):
void
;
$startDebugging
(
folder
:
UriComponents
|
undefined
,
nameOrConfig
:
string
|
IDebugConfiguration
,
parentSessionID
:
string
|
undefined
):
Promise
<
boolean
>
;
$customDebugAdapterRequest
(
id
:
DebugSessionUUID
,
command
:
string
,
args
:
any
):
Promise
<
any
>
;
$appendDebugConsole
(
value
:
string
):
void
;
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
9af6cea0
...
...
@@ -307,11 +307,8 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
const
handle
=
this
.
_trackerFactoryHandleCounter
++
;
this
.
_trackerFactories
.
push
({
type
,
handle
,
factory
});
this
.
_debugServiceProxy
.
$registerDebugAdapterTrackerFactory
(
type
,
handle
);
return
new
Disposable
(()
=>
{
this
.
_trackerFactories
=
this
.
_trackerFactories
.
filter
(
p
=>
p
.
factory
!==
factory
);
// remove
this
.
_debugServiceProxy
.
$unregisterDebugAdapterTrackerFactory
(
handle
);
});
}
...
...
src/vs/workbench/contrib/debug/common/debug.ts
浏览文件 @
9af6cea0
...
...
@@ -604,7 +604,6 @@ export interface IConfigurationManager {
activateDebuggers
(
activationEvent
:
string
,
debugType
?:
string
):
Promise
<
void
>
;
needsToRunInExtHost
(
debugType
:
string
):
boolean
;
hasDebugConfigurationProvider
(
debugType
:
string
):
boolean
;
registerDebugConfigurationProvider
(
debugConfigurationProvider
:
IDebugConfigurationProvider
):
IDisposable
;
...
...
@@ -613,9 +612,6 @@ export interface IConfigurationManager {
registerDebugAdapterDescriptorFactory
(
debugAdapterDescriptorFactory
:
IDebugAdapterDescriptorFactory
):
IDisposable
;
unregisterDebugAdapterDescriptorFactory
(
debugAdapterDescriptorFactory
:
IDebugAdapterDescriptorFactory
):
void
;
registerDebugAdapterTrackerFactory
(
debugAdapterTrackerFactory
:
IDebugAdapterTrackerFactory
):
IDisposable
;
unregisterDebugAdapterTrackerFactory
(
debugAdapterTrackerFactory
:
IDebugAdapterTrackerFactory
):
void
;
resolveConfigurationByProviders
(
folderUri
:
uri
|
undefined
,
type
:
string
|
undefined
,
debugConfiguration
:
any
):
Promise
<
any
>
;
getDebugAdapterDescriptor
(
session
:
IDebugSession
):
Promise
<
IAdapterDescriptor
|
undefined
>
;
...
...
src/vs/workbench/contrib/debug/electron-browser/debugConfigurationManager.ts
浏览文件 @
9af6cea0
...
...
@@ -21,7 +21,7 @@ import { IFileService } from 'vs/platform/files/common/files';
import
{
IWorkspaceContextService
,
IWorkspaceFolder
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IDebugConfigurationProvider
,
ICompound
,
IDebugConfiguration
,
IConfig
,
IGlobalConfig
,
IConfigurationManager
,
ILaunch
,
IDebugAdapterDescriptorFactory
,
IDebugAdapter
,
ITerminalSettings
,
ITerminalLauncher
,
IDebugSession
,
IAdapterDescriptor
,
CONTEXT_DEBUG_CONFIGURATION_TYPE
,
IDebugAdapterFactory
,
IDebug
AdapterTrackerFactory
,
IDebug
Service
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IDebugConfigurationProvider
,
ICompound
,
IDebugConfiguration
,
IConfig
,
IGlobalConfig
,
IConfigurationManager
,
ILaunch
,
IDebugAdapterDescriptorFactory
,
IDebugAdapter
,
ITerminalSettings
,
ITerminalLauncher
,
IDebugSession
,
IAdapterDescriptor
,
CONTEXT_DEBUG_CONFIGURATION_TYPE
,
IDebugAdapterFactory
,
IDebugService
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
Debugger
}
from
'
vs/workbench/contrib/debug/node/debugger
'
;
import
{
IEditorService
,
ACTIVE_GROUP
,
SIDE_GROUP
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
isCodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
...
...
@@ -52,7 +52,6 @@ export class ConfigurationManager implements IConfigurationManager {
private
_onDidSelectConfigurationName
=
new
Emitter
<
void
>
();
private
configProviders
:
IDebugConfigurationProvider
[];
private
adapterDescriptorFactories
:
IDebugAdapterDescriptorFactory
[];
private
adapterTrackerFactories
:
IDebugAdapterTrackerFactory
[];
private
debugAdapterFactories
:
Map
<
string
,
IDebugAdapterFactory
>
;
private
terminalLauncher
:
ITerminalLauncher
;
private
debugConfigurationTypeContext
:
IContextKey
<
string
>
;
...
...
@@ -72,7 +71,6 @@ export class ConfigurationManager implements IConfigurationManager {
)
{
this
.
configProviders
=
[];
this
.
adapterDescriptorFactories
=
[];
this
.
adapterTrackerFactories
=
[];
this
.
debuggers
=
[];
this
.
toDispose
=
[];
this
.
registerListeners
(
lifecycleService
);
...
...
@@ -164,24 +162,6 @@ export class ConfigurationManager implements IConfigurationManager {
return
Promise
.
resolve
(
undefined
);
}
// debug adapter trackers
registerDebugAdapterTrackerFactory
(
debugAdapterTrackerFactory
:
IDebugAdapterTrackerFactory
):
IDisposable
{
this
.
adapterTrackerFactories
.
push
(
debugAdapterTrackerFactory
);
return
{
dispose
:
()
=>
{
this
.
unregisterDebugAdapterTrackerFactory
(
debugAdapterTrackerFactory
);
}
};
}
unregisterDebugAdapterTrackerFactory
(
debugAdapterTrackerFactory
:
IDebugAdapterTrackerFactory
):
void
{
const
ix
=
this
.
adapterTrackerFactories
.
indexOf
(
debugAdapterTrackerFactory
);
if
(
ix
>=
0
)
{
this
.
adapterTrackerFactories
.
splice
(
ix
,
1
);
}
}
// debug configurations
registerDebugConfigurationProvider
(
debugConfigurationProvider
:
IDebugConfigurationProvider
):
IDisposable
{
...
...
@@ -206,13 +186,6 @@ export class ConfigurationManager implements IConfigurationManager {
return
providers
.
length
>
0
;
}
needsToRunInExtHost
(
debugType
:
string
):
boolean
{
// if the given debugType matches any registered tracker factory we need to run the DA in the EH
const
providers
=
this
.
adapterTrackerFactories
.
filter
(
p
=>
p
.
type
===
debugType
||
p
.
type
===
'
*
'
);
return
providers
.
length
>
0
;
}
resolveConfigurationByProviders
(
folderUri
:
uri
|
undefined
,
type
:
string
|
undefined
,
debugConfiguration
:
IConfig
):
Promise
<
IConfig
|
null
|
undefined
>
{
return
this
.
activateDebuggers
(
'
onDebugResolve
'
,
type
).
then
(()
=>
{
// pipe the config through the promises sequentially. Append at the end the '*' types
...
...
src/vs/workbench/contrib/debug/node/debugger.ts
浏览文件 @
9af6cea0
...
...
@@ -11,11 +11,9 @@ import { isObject } from 'vs/base/common/types';
import
{
TelemetryAppenderClient
}
from
'
vs/platform/telemetry/node/telemetryIpc
'
;
import
{
IJSONSchema
,
IJSONSchemaSnippet
}
from
'
vs/base/common/jsonSchema
'
;
import
{
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IConfig
,
IDebuggerContribution
,
I
DebugAdapterExecutable
,
INTERNAL_CONSOLE_OPTIONS_SCHEMA
,
IConfigurationManager
,
IDebugAdapter
,
ITerminalSettings
,
IDebugger
,
IDebugSession
,
IAdapterDescriptor
,
IDebugAdapterServer
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IConfig
,
IDebuggerContribution
,
I
NTERNAL_CONSOLE_OPTIONS_SCHEMA
,
IConfigurationManager
,
IDebugAdapter
,
ITerminalSettings
,
IDebugger
,
IDebugSession
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IOutputService
}
from
'
vs/workbench/contrib/output/common/output
'
;
import
{
ExecutableDebugAdapter
,
SocketDebugAdapter
}
from
'
vs/workbench/contrib/debug/node/debugAdapter
'
;
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
*
as
ConfigurationResolverUtils
from
'
vs/workbench/services/configurationResolver/common/configurationResolverUtils
'
;
import
{
TelemetryService
}
from
'
vs/platform/telemetry/common/telemetryService
'
;
...
...
@@ -38,7 +36,6 @@ export class Debugger implements IDebugger {
constructor
(
private
configurationManager
:
IConfigurationManager
,
dbgContribution
:
IDebuggerContribution
,
extensionDescription
:
IExtensionDescription
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
ITextResourcePropertiesService
private
readonly
resourcePropertiesService
:
ITextResourcePropertiesService
,
@
ICommandService
private
readonly
commandService
:
ICommandService
,
@
IConfigurationResolverService
private
readonly
configurationResolverService
:
IConfigurationResolverService
,
@
ITelemetryService
private
readonly
telemetryService
:
ITelemetryService
,
)
{
...
...
@@ -99,95 +96,23 @@ export class Debugger implements IDebugger {
public
createDebugAdapter
(
session
:
IDebugSession
,
outputService
:
IOutputService
):
Promise
<
IDebugAdapter
>
{
return
this
.
configurationManager
.
activateDebuggers
(
'
onDebugAdapterProtocolTracker
'
,
this
.
type
).
then
(
_
=>
{
if
(
this
.
inExtHost
())
{
const
da
=
this
.
configurationManager
.
createDebugAdapter
(
session
);
if
(
da
)
{
return
Promise
.
resolve
(
da
);
}
throw
new
Error
(
nls
.
localize
(
'
cannot.find.da
'
,
"
Cannot find debug adapter for type '{0}'.
"
,
this
.
type
));
}
else
{
return
this
.
getAdapterDescriptor
(
session
).
then
(
adapterDescriptor
=>
{
switch
(
adapterDescriptor
.
type
)
{
case
'
executable
'
:
return
new
ExecutableDebugAdapter
(
adapterDescriptor
,
this
.
type
,
outputService
);
case
'
server
'
:
return
new
SocketDebugAdapter
(
adapterDescriptor
);
case
'
implementation
'
:
// TODO@AW: this.inExtHost() should now return true
return
Promise
.
resolve
(
this
.
configurationManager
.
createDebugAdapter
(
session
));
default
:
throw
new
Error
(
'
unknown descriptor type
'
);
}
}).
catch
(
err
=>
{
if
(
err
&&
err
.
message
)
{
throw
new
Error
(
nls
.
localize
(
'
cannot.create.da.with.err
'
,
"
Cannot create debug adapter ({0}).
"
,
err
.
message
));
}
else
{
throw
new
Error
(
nls
.
localize
(
'
cannot.create.da
'
,
"
Cannot create debug adapter.
"
));
}
});
const
da
=
this
.
configurationManager
.
createDebugAdapter
(
session
);
if
(
da
)
{
return
Promise
.
resolve
(
da
);
}
});
}
private
getAdapterDescriptor
(
session
:
IDebugSession
):
Promise
<
IAdapterDescriptor
>
{
// a "debugServer" attribute in the launch config takes precedence
if
(
typeof
session
.
configuration
.
debugServer
===
'
number
'
)
{
return
Promise
.
resolve
(
<
IDebugAdapterServer
>
{
type
:
'
server
'
,
port
:
session
.
configuration
.
debugServer
});
}
// try the new "createDebugAdapterDescriptor" and the deprecated "provideDebugAdapter" API
return
this
.
configurationManager
.
getDebugAdapterDescriptor
(
session
).
then
(
adapter
=>
{
if
(
adapter
)
{
return
adapter
;
}
// try deprecated command based extension API "adapterExecutableCommand" to determine the executable
if
(
this
.
debuggerContribution
.
adapterExecutableCommand
)
{
console
.
info
(
'
debugAdapterExecutable attribute in package.json is deprecated and support for it will be removed soon; please use DebugAdapterDescriptorFactory.createDebugAdapterDescriptor instead.
'
);
const
rootFolder
=
session
.
root
?
session
.
root
.
uri
.
toString
()
:
undefined
;
return
this
.
commandService
.
executeCommand
<
IDebugAdapterExecutable
>
(
this
.
debuggerContribution
.
adapterExecutableCommand
,
rootFolder
).
then
(
ae
=>
{
if
(
ae
)
{
return
<
IAdapterDescriptor
>
{
type
:
'
executable
'
,
command
:
ae
.
command
,
args
:
ae
.
args
||
[]
};
}
throw
new
Error
(
'
command adapterExecutableCommand did not return proper command.
'
);
});
}
// fallback: use executable information from package.json
const
ae
=
ExecutableDebugAdapter
.
platformAdapterExecutable
(
this
.
mergedExtensionDescriptions
,
this
.
type
);
if
(
ae
===
undefined
)
{
throw
new
Error
(
'
no executable specified in package.json
'
);
}
return
ae
;
throw
new
Error
(
nls
.
localize
(
'
cannot.find.da
'
,
"
Cannot find debug adapter for type '{0}'.
"
,
this
.
type
));
});
}
substituteVariables
(
folder
:
IWorkspaceFolder
|
undefined
,
config
:
IConfig
):
Promise
<
IConfig
>
{
if
(
this
.
inExtHost
())
{
return
this
.
configurationManager
.
substituteVariables
(
this
.
type
,
folder
,
config
).
then
(
config
=>
{
return
this
.
configurationResolverService
.
resolveWithInteractionReplace
(
folder
,
config
,
'
launch
'
,
this
.
variables
);
});
}
else
{
return
this
.
configurationManager
.
substituteVariables
(
this
.
type
,
folder
,
config
).
then
(
config
=>
{
return
this
.
configurationResolverService
.
resolveWithInteractionReplace
(
folder
,
config
,
'
launch
'
,
this
.
variables
);
}
}
);
}
runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
):
Promise
<
number
|
undefined
>
{
const
config
=
this
.
configurationService
.
getValue
<
ITerminalSettings
>
(
'
terminal
'
);
return
this
.
configurationManager
.
runInTerminal
(
this
.
inExtHost
()
?
this
.
type
:
'
*
'
,
args
,
config
);
}
private
inExtHost
():
boolean
{
return
true
;
return
this
.
configurationManager
.
runInTerminal
(
this
.
type
,
args
,
config
);
}
get
label
():
string
{
...
...
src/vs/workbench/contrib/debug/test/node/debugger.test.ts
浏览文件 @
9af6cea0
...
...
@@ -130,7 +130,7 @@ suite('Debug - Debugger', () => {
const
testResourcePropertiesService
=
new
TestTextResourcePropertiesService
(
configurationService
);
setup
(()
=>
{
_debugger
=
new
Debugger
(
configurationManager
,
debuggerContribution
,
extensionDescriptor0
,
configurationService
,
testResourcePropertiesService
,
undefined
!
,
undefined
!
,
undefined
!
);
_debugger
=
new
Debugger
(
configurationManager
,
debuggerContribution
,
extensionDescriptor0
,
configurationService
,
testResourcePropertiesService
,
undefined
!
,
undefined
!
);
});
teardown
(()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录