Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
132ddb4e
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,发现更多精彩内容 >>
提交
132ddb4e
编写于
11月 06, 2018
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup debugConfigurationProviders properly
上级
87f69fec
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
22 deletion
+37
-22
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
.../workbench/api/electron-browser/mainThreadDebugService.ts
+10
-3
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+3
-3
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
...parts/debug/electron-browser/debugConfigurationManager.ts
+20
-15
src/vs/workbench/parts/debug/node/debugger.ts
src/vs/workbench/parts/debug/node/debugger.ts
+4
-1
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
浏览文件 @
132ddb4e
...
...
@@ -25,6 +25,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
private
_breakpointEventsActive
:
boolean
;
private
_debugAdapters
:
Map
<
number
,
ExtensionHostDebugAdapter
>
;
private
_debugAdaptersHandleCounter
=
1
;
private
_debugConfigurationProviders
:
Map
<
number
,
IDebugConfigurationProvider
>
;
constructor
(
extHostContext
:
IExtHostContext
,
...
...
@@ -46,7 +47,8 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
this
.
_proxy
.
$acceptDebugSessionActiveChanged
(
this
.
getSessionDto
(
session
));
}));
this
.
_debugAdapters
=
new
Map
<
number
,
ExtensionHostDebugAdapter
>
();
this
.
_debugAdapters
=
new
Map
();
this
.
_debugConfigurationProviders
=
new
Map
();
}
public
dispose
():
void
{
...
...
@@ -166,13 +168,18 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
return
Promise
.
resolve
(
this
.
_proxy
.
$provideDebugAdapter
(
handle
,
this
.
getSessionDto
(
session
),
folder
,
config
));
};
}
this
.
debugService
.
getConfigurationManager
().
registerDebugConfigurationProvider
(
handle
,
provider
);
this
.
_debugConfigurationProviders
.
set
(
handle
,
provider
);
this
.
_toDispose
.
push
(
this
.
debugService
.
getConfigurationManager
().
registerDebugConfigurationProvider
(
provider
));
return
Promise
.
resolve
(
undefined
);
}
public
$unregisterDebugConfigurationProvider
(
handle
:
number
):
Thenable
<
void
>
{
this
.
debugService
.
getConfigurationManager
().
unregisterDebugConfigurationProvider
(
handle
);
const
provider
=
this
.
_debugConfigurationProviders
.
get
(
handle
);
if
(
provider
)
{
this
.
_debugConfigurationProviders
.
delete
(
handle
);
this
.
debugService
.
getConfigurationManager
().
unregisterDebugConfigurationProvider
(
provider
);
}
return
TPromise
.
wrap
<
void
>
(
undefined
);
}
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
132ddb4e
...
...
@@ -518,7 +518,6 @@ export interface IDebuggerContribution extends IPlatformSpecificAdapterContribut
export
interface
IDebugConfigurationProvider
{
readonly
type
:
string
;
handle
:
number
;
resolveDebugConfiguration
?(
folderUri
:
uri
|
undefined
,
debugConfiguration
:
IConfig
):
Promise
<
IConfig
>
;
provideDebugConfigurations
?(
folderUri
:
uri
|
undefined
):
Promise
<
IConfig
[]
>
;
provideDebugAdapter
?(
session
:
IDebugSession
,
folderUri
:
uri
|
undefined
,
config
:
IConfig
):
Promise
<
IAdapterDescriptor
>
;
...
...
@@ -570,9 +569,10 @@ export interface IConfigurationManager {
onDidSelectConfiguration
:
Event
<
void
>
;
needsToRunInExtHost
(
debugType
:
string
):
boolean
;
hasDebugConfigurationProvider
(
debugType
:
string
):
boolean
;
registerDebugConfigurationProvider
(
handle
:
number
,
debugConfigurationProvider
:
IDebugConfigurationProvider
):
void
;
unregisterDebugConfigurationProvider
(
handle
:
numb
er
):
void
;
registerDebugConfigurationProvider
(
debugConfigurationProvider
:
IDebugConfigurationProvider
):
IDisposable
;
unregisterDebugConfigurationProvider
(
debugConfigurationProvider
:
IDebugConfigurationProvid
er
):
void
;
resolveConfigurationByProviders
(
folderUri
:
uri
|
undefined
,
type
:
string
|
undefined
,
debugConfiguration
:
any
):
Thenable
<
any
>
;
provideDebugAdapter
(
session
:
IDebugSession
,
folderUri
:
uri
|
undefined
,
config
:
IConfig
):
Promise
<
IAdapterDescriptor
|
undefined
>
;
...
...
src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts
浏览文件 @
132ddb4e
...
...
@@ -79,31 +79,36 @@ export class ConfigurationManager implements IConfigurationManager {
}
}
public
registerDebugConfigurationProvider
(
handle
:
number
,
debugConfigurationProvider
:
IDebugConfigurationProvider
):
void
{
if
(
!
debugConfigurationProvider
)
{
return
;
}
public
registerDebugConfigurationProvider
(
debugConfigurationProvider
:
IDebugConfigurationProvider
):
IDisposable
{
debugConfigurationProvider
.
handle
=
handle
;
this
.
providers
=
this
.
providers
.
filter
(
p
=>
p
.
handle
!==
handle
);
this
.
providers
.
push
(
debugConfigurationProvider
);
const
dbg
=
this
.
getDebugger
(
debugConfigurationProvider
.
type
);
// Check if the provider contributes provideDebugConfigurations method
if
(
dbg
&&
debugConfigurationProvider
.
provideDebugConfigurations
)
{
dbg
.
hasConfigurationProvider
=
true
;
return
{
dispose
:
()
=>
{
this
.
unregisterDebugConfigurationProvider
(
debugConfigurationProvider
);
}
};
}
public
unregisterDebugConfigurationProvider
(
debugConfigurationProvider
:
IDebugConfigurationProvider
):
void
{
const
ix
=
this
.
providers
.
indexOf
(
debugConfigurationProvider
);
if
(
ix
>=
0
)
{
this
.
providers
.
splice
(
ix
,
1
);
}
}
public
hasDebugConfigurationProvider
(
debugType
:
string
):
boolean
{
// check if there are providers for the given type that contribute a provideDebugConfigurations method
const
providers
=
this
.
providers
.
filter
(
p
=>
p
.
provideDebugConfigurations
&&
(
p
.
type
===
debugType
));
return
providers
.
length
>
0
;
}
public
needsToRunInExtHost
(
debugType
:
string
):
boolean
{
// if the given debugType matches any registered provider that has a provideTracker method, we need to run the DA in the EH
const
providers
=
this
.
providers
.
filter
(
p
=>
p
.
hasTracker
&&
(
p
.
type
===
debugType
||
p
.
type
===
'
*
'
));
return
providers
.
length
>
0
;
}
public
unregisterDebugConfigurationProvider
(
handle
:
number
):
void
{
this
.
providers
=
this
.
providers
.
filter
(
p
=>
p
.
handle
!==
handle
);
}
public
resolveConfigurationByProviders
(
folderUri
:
uri
|
undefined
,
type
:
string
|
undefined
,
debugConfiguration
:
IConfig
):
Thenable
<
IConfig
>
{
return
this
.
activateDebuggers
(
`onDebugResolve:
${
type
}
`
).
then
(()
=>
{
// pipe the config through the promises sequentially. append at the end the '*' types
...
...
@@ -358,7 +363,7 @@ export class ConfigurationManager implements IConfigurationManager {
}
if
(
!
candidates
)
{
candidates
=
this
.
activateDebuggers
(
'
onDebugInitialConfigurations
'
).
then
(()
=>
this
.
debuggers
.
filter
(
a
=>
a
.
hasInitialConfiguration
()
||
a
.
hasConfigurationProvider
));
candidates
=
this
.
activateDebuggers
(
'
onDebugInitialConfigurations
'
).
then
(()
=>
this
.
debuggers
.
filter
(
dbg
=>
dbg
.
hasInitialConfiguration
()
||
dbg
.
hasConfigurationProvider
()
));
}
return
candidates
.
then
(
debuggers
=>
{
...
...
src/vs/workbench/parts/debug/node/debugger.ts
浏览文件 @
132ddb4e
...
...
@@ -40,7 +40,6 @@ export class Debugger implements IDebugger {
this
.
mergedExtensionDescriptions
=
[
extensionDescription
];
}
public
hasConfigurationProvider
=
false
;
public
createDebugAdapter
(
session
:
IDebugSession
,
root
:
IWorkspaceFolder
,
config
:
IConfig
,
outputService
:
IOutputService
):
Promise
<
IDebugAdapter
>
{
if
(
this
.
inExtHost
())
{
...
...
@@ -149,6 +148,10 @@ export class Debugger implements IDebugger {
return
!!
this
.
debuggerContribution
.
initialConfigurations
;
}
public
hasConfigurationProvider
()
{
this
.
configurationManager
.
hasDebugConfigurationProvider
(
this
.
type
);
}
public
getInitialConfigurationContent
(
initialConfigs
?:
IConfig
[]):
Promise
<
string
>
{
// at this point we got some configs from the package.json and/or from registered DebugConfigurationProviders
let
initialConfigurations
=
this
.
debuggerContribution
.
initialConfigurations
||
[];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录