Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ac1df80c
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,发现更多精彩内容 >>
提交
ac1df80c
编写于
1月 18, 2019
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
makde debuggers extension point contribution dynamic #66574
上级
e7ee83ef
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
8 deletion
+21
-8
src/vs/workbench/parts/debug/common/debugSchemas.ts
src/vs/workbench/parts/debug/common/debugSchemas.ts
+1
-0
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
...parts/debug/electron-browser/debugConfigurationManager.ts
+19
-7
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+1
-1
未找到文件。
src/vs/workbench/parts/debug/common/debugSchemas.ts
浏览文件 @
ac1df80c
...
...
@@ -13,6 +13,7 @@ import { inputsSchema } from 'vs/workbench/services/configurationResolver/common
// debuggers extension point
export
const
debuggersExtPoint
=
extensionsRegistry
.
ExtensionsRegistry
.
registerExtensionPoint
<
IDebuggerContribution
[]
>
({
extensionPoint
:
'
debuggers
'
,
isDynamic
:
true
,
jsonSchema
:
{
description
:
nls
.
localize
(
'
vscode.extension.contributes.debuggers
'
,
'
Contributes debug adapters.
'
),
type
:
'
array
'
,
...
...
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
浏览文件 @
ac1df80c
...
...
@@ -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
,
IDebugAdapterTrackerFactory
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IDebugConfigurationProvider
,
ICompound
,
IDebugConfiguration
,
IConfig
,
IGlobalConfig
,
IConfigurationManager
,
ILaunch
,
IDebugAdapterDescriptorFactory
,
IDebugAdapter
,
ITerminalSettings
,
ITerminalLauncher
,
IDebugSession
,
IAdapterDescriptor
,
CONTEXT_DEBUG_CONFIGURATION_TYPE
,
IDebugAdapterFactory
,
IDebugAdapterTrackerFactory
,
IDebugService
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
Debugger
}
from
'
vs/workbench/parts/debug/node/debugger
'
;
import
{
IEditorService
,
ACTIVE_GROUP
,
SIDE_GROUP
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
isCodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
...
...
@@ -33,6 +33,7 @@ import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/plat
import
{
launchSchema
,
debuggersExtPoint
,
breakpointsExtPoint
}
from
'
vs/workbench/parts/debug/common/debugSchemas
'
;
import
{
IQuickInputService
}
from
'
vs/platform/quickinput/common/quickInput
'
;
import
{
IContextKeyService
,
IContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
const
jsonRegistry
=
Registry
.
as
<
IJSONContributionRegistry
>
(
JSONExtensions
.
JSONContribution
);
jsonRegistry
.
registerSchema
(
launchSchemaId
,
launchSchema
);
...
...
@@ -56,6 +57,7 @@ export class ConfigurationManager implements IConfigurationManager {
private
debugConfigurationTypeContext
:
IContextKey
<
string
>
;
constructor
(
private
debugService
:
IDebugService
,
@
IWorkspaceContextService
private
readonly
contextService
:
IWorkspaceContextService
,
@
IEditorService
private
readonly
editorService
:
IEditorService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
...
...
@@ -235,11 +237,11 @@ export class ConfigurationManager implements IConfigurationManager {
}
private
registerListeners
(
lifecycleService
:
ILifecycleService
):
void
{
debuggersExtPoint
.
setHandler
((
extensions
)
=>
{
extensions
.
forEach
(
extension
=>
{
extension
.
value
.
forEach
(
rawAdapter
=>
{
debuggersExtPoint
.
setHandler
((
extensions
,
delta
)
=>
{
delta
.
added
.
forEach
(
added
=>
{
added
.
value
.
forEach
(
rawAdapter
=>
{
if
(
!
rawAdapter
.
type
||
(
typeof
rawAdapter
.
type
!==
'
string
'
))
{
extension
.
collector
.
error
(
nls
.
localize
(
'
debugNoType
'
,
"
Debugger 'type' can not be omitted and must be of type 'string'.
"
));
added
.
collector
.
error
(
nls
.
localize
(
'
debugNoType
'
,
"
Debugger 'type' can not be omitted and must be of type 'string'.
"
));
}
if
(
rawAdapter
.
enableBreakpointsFor
)
{
rawAdapter
.
enableBreakpointsFor
.
languageIds
.
forEach
(
modeId
=>
{
...
...
@@ -249,9 +251,19 @@ export class ConfigurationManager implements IConfigurationManager {
const
duplicate
=
this
.
getDebugger
(
rawAdapter
.
type
);
if
(
duplicate
)
{
duplicate
.
merge
(
rawAdapter
,
extension
.
description
);
duplicate
.
merge
(
rawAdapter
,
added
.
description
);
}
else
{
this
.
debuggers
.
push
(
this
.
instantiationService
.
createInstance
(
Debugger
,
this
,
rawAdapter
,
extension
.
description
));
this
.
debuggers
.
push
(
this
.
instantiationService
.
createInstance
(
Debugger
,
this
,
rawAdapter
,
added
.
description
));
}
});
});
delta
.
removed
.
forEach
(
removed
=>
{
const
removedTypes
=
removed
.
value
.
map
(
rawAdapter
=>
rawAdapter
.
type
);
this
.
debuggers
=
this
.
debuggers
.
filter
(
d
=>
removedTypes
.
indexOf
(
d
.
type
)
===
-
1
);
this
.
debugService
.
getModel
().
getSessions
().
forEach
(
s
=>
{
// Stop sessions if their debugger has been removed
if
(
removedTypes
.
indexOf
(
s
.
configuration
.
type
)
>=
0
)
{
this
.
debugService
.
stopSession
(
s
).
then
(
undefined
,
onUnexpectedError
);
}
});
});
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
ac1df80c
...
...
@@ -119,7 +119,7 @@ export class DebugService implements IDebugService {
this
.
_onWillNewSession
=
new
Emitter
<
IDebugSession
>
();
this
.
_onDidEndSession
=
new
Emitter
<
IDebugSession
>
();
this
.
configurationManager
=
this
.
instantiationService
.
createInstance
(
ConfigurationManager
);
this
.
configurationManager
=
this
.
instantiationService
.
createInstance
(
ConfigurationManager
,
this
);
this
.
toDispose
.
push
(
this
.
configurationManager
);
this
.
debugType
=
CONTEXT_DEBUG_TYPE
.
bindTo
(
contextKeyService
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录