Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4573042a
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,发现更多精彩内容 >>
提交
4573042a
编写于
2月 07, 2019
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
properly merge debugger contributions
上级
b5ff5a17
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
40 addition
and
25 deletion
+40
-25
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+2
-3
src/vs/workbench/contrib/debug/common/debugUtils.ts
src/vs/workbench/contrib/debug/common/debugUtils.ts
+6
-1
src/vs/workbench/contrib/debug/electron-browser/debugConfigurationManager.ts
...ntrib/debug/electron-browser/debugConfigurationManager.ts
+3
-3
src/vs/workbench/contrib/debug/electron-browser/debugService.ts
.../workbench/contrib/debug/electron-browser/debugService.ts
+1
-1
src/vs/workbench/contrib/debug/node/debugger.ts
src/vs/workbench/contrib/debug/node/debugger.ts
+28
-17
未找到文件。
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
4573042a
...
...
@@ -24,7 +24,7 @@ import { getTerminalLauncher, hasChildProcesses, prepareCommand } from 'vs/workb
import
{
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
AbstractVariableResolverService
}
from
'
vs/workbench/services/configurationResolver/node/variableResolver
'
;
import
{
ExtHostConfiguration
,
ExtHostConfigProvider
}
from
'
./extHostConfiguration
'
;
import
{
convertToVSCPaths
,
convertToDAPaths
}
from
'
vs/workbench/contrib/debug/common/debugUtils
'
;
import
{
convertToVSCPaths
,
convertToDAPaths
,
isDebuggerMainContribution
}
from
'
vs/workbench/contrib/debug/common/debugUtils
'
;
import
{
ExtHostTerminalService
}
from
'
vs/workbench/api/node/extHostTerminalService
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
...
...
@@ -128,8 +128,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
const
debuggers
=
<
IDebuggerContribution
[]
>
ed
.
contributes
[
'
debuggers
'
];
if
(
debuggers
&&
debuggers
.
length
>
0
)
{
for
(
const
dbg
of
debuggers
)
{
// only debugger contributions with a label, program, or runtime attribute are considered a "defining" debugger contribution
if
(
dbg
.
type
&&
(
dbg
.
label
||
dbg
.
program
||
dbg
.
runtime
))
{
if
(
isDebuggerMainContribution
(
dbg
))
{
debugTypes
.
push
(
dbg
.
type
);
if
(
dbg
.
adapterExecutableCommand
)
{
this
.
_aexCommands
.
set
(
dbg
.
type
,
dbg
.
adapterExecutableCommand
);
...
...
src/vs/workbench/contrib/debug/common/debugUtils.ts
浏览文件 @
4573042a
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
equalsIgnoreCase
}
from
'
vs/base/common/strings
'
;
import
{
IConfig
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
IConfig
,
IDebuggerContribution
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
URI
as
uri
}
from
'
vs/base/common/uri
'
;
import
{
isAbsolute_posix
,
isAbsolute_win32
}
from
'
vs/base/common/paths
'
;
import
{
deepClone
}
from
'
vs/base/common/objects
'
;
...
...
@@ -27,6 +27,11 @@ export function isExtensionHostDebugging(config: IConfig) {
return
config
.
type
&&
equalsIgnoreCase
(
config
.
type
===
'
vslsShare
'
?
(
<
any
>
config
).
adapterProxy
.
configuration
.
type
:
config
.
type
,
'
extensionhost
'
);
}
// only a debugger contributions with a label, program, or runtime attribute is considered a "defining" or "main" debugger contribution
export
function
isDebuggerMainContribution
(
dbg
:
IDebuggerContribution
)
{
return
dbg
.
type
&&
(
dbg
.
label
||
dbg
.
program
||
dbg
.
runtime
);
}
export
function
getExactExpressionStartAndEnd
(
lineContent
:
string
,
looseStart
:
number
,
looseEnd
:
number
):
{
start
:
number
,
end
:
number
}
{
let
matchingExpression
:
string
|
undefined
=
undefined
;
let
startOffset
=
0
;
...
...
src/vs/workbench/contrib/debug/electron-browser/debugConfigurationManager.ts
浏览文件 @
4573042a
...
...
@@ -249,9 +249,9 @@ export class ConfigurationManager implements IConfigurationManager {
});
}
const
duplicate
=
this
.
getDebugger
(
rawAdapter
.
type
);
if
(
duplicate
)
{
duplicate
.
merge
(
rawAdapter
,
added
.
description
);
const
existing
=
this
.
getDebugger
(
rawAdapter
.
type
);
if
(
existing
)
{
existing
.
merge
(
rawAdapter
,
added
.
description
);
}
else
{
this
.
debuggers
.
push
(
this
.
instantiationService
.
createInstance
(
Debugger
,
this
,
rawAdapter
,
added
.
description
));
}
...
...
src/vs/workbench/contrib/debug/electron-browser/debugService.ts
浏览文件 @
4573042a
...
...
@@ -1016,7 +1016,7 @@ export class DebugService implements IDebugService {
//---- telemetry
private
telemetryDebugSessionStart
(
root
:
IWorkspaceFolder
,
type
:
string
):
Promise
<
any
>
{
const
extension
=
this
.
configurationManager
.
getDebugger
(
type
).
extensionDescription
;
const
extension
=
this
.
configurationManager
.
getDebugger
(
type
).
getMainExtensionDescriptor
()
;
/* __GDPR__
"debugSessionStart" : {
"type": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
...
...
src/vs/workbench/contrib/debug/node/debugger.ts
浏览文件 @
4573042a
...
...
@@ -26,19 +26,36 @@ import { getPathFromAmdModule } from 'vs/base/common/amd';
import
{
ITextResourcePropertiesService
}
from
'
vs/editor/common/services/resourceConfiguration
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
isDebuggerMainContribution
}
from
'
vs/workbench/contrib/debug/common/debugUtils
'
;
export
class
Debugger
implements
IDebugger
{
private
mergedExtensionDescriptions
:
IExtensionDescription
[];
private
debuggerContribution
:
IDebuggerContribution
=
{};
private
mergedExtensionDescriptions
:
IExtensionDescription
[]
=
[];
private
mainExtensionDescription
:
IExtensionDescription
|
undefined
;
constructor
(
private
configurationManager
:
IConfigurationManager
,
private
debuggerContribution
:
IDebuggerContribution
,
public
extensionDescription
:
IExtensionDescription
,
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
,
)
{
this
.
mergedExtensionDescriptions
=
[
extensionDescription
];
this
.
merge
(
dbgContribution
,
extensionDescription
);
}
public
merge
(
otherDebuggerContribution
:
IDebuggerContribution
,
extensionDescription
:
IExtensionDescription
):
void
{
// remember all extensions that are merged for this debugger
this
.
mergedExtensionDescriptions
.
push
(
extensionDescription
);
// merge debugger contributions
objects
.
mixin
(
this
.
debuggerContribution
,
otherDebuggerContribution
,
extensionDescription
.
isBuiltin
);
// remember the extension that has the "main" debugger contribution
if
(
isDebuggerMainContribution
(
otherDebuggerContribution
))
{
this
.
mainExtensionDescription
=
extensionDescription
;
}
}
public
createDebugAdapter
(
session
:
IDebugSession
,
outputService
:
IOutputService
):
Promise
<
IDebugAdapter
>
{
...
...
@@ -129,7 +146,9 @@ export class Debugger implements IDebugger {
private
inExtHost
():
boolean
{
const
debugConfigs
=
this
.
configurationService
.
getValue
<
IDebugConfiguration
>
(
'
debug
'
);
return
debugConfigs
.
extensionHostDebugAdapter
||
this
.
configurationManager
.
needsToRunInExtHost
(
this
.
type
)
||
this
.
extensionDescription
.
extensionLocation
.
scheme
!==
'
file
'
;
return
debugConfigs
.
extensionHostDebugAdapter
||
this
.
configurationManager
.
needsToRunInExtHost
(
this
.
type
)
||
(
this
.
mainExtensionDescription
&&
this
.
mainExtensionDescription
.
extensionLocation
.
scheme
!==
'
file
'
);
}
get
label
():
string
{
...
...
@@ -152,18 +171,6 @@ export class Debugger implements IDebugger {
return
this
.
debuggerContribution
.
languages
;
}
merge
(
secondRawAdapter
:
IDebuggerContribution
,
extensionDescription
:
IExtensionDescription
):
void
{
// remember all ext descriptions that are the source of this debugger
this
.
mergedExtensionDescriptions
.
push
(
extensionDescription
);
// Give priority to built in debug adapters
if
(
extensionDescription
.
isBuiltin
)
{
this
.
extensionDescription
=
extensionDescription
;
}
objects
.
mixin
(
this
.
debuggerContribution
,
secondRawAdapter
,
extensionDescription
.
isBuiltin
);
}
hasInitialConfiguration
():
boolean
{
return
!!
this
.
debuggerContribution
.
initialConfigurations
;
}
...
...
@@ -204,6 +211,10 @@ export class Debugger implements IDebugger {
return
Promise
.
resolve
(
content
);
}
public
getMainExtensionDescriptor
():
IExtensionDescription
{
return
this
.
mainExtensionDescription
||
this
.
mergedExtensionDescriptions
[
0
];
}
@
memoize
getCustomTelemetryService
():
Promise
<
TelemetryService
>
{
if
(
!
this
.
debuggerContribution
.
aiKey
)
{
...
...
@@ -221,7 +232,7 @@ export class Debugger implements IDebugger {
{
serverName
:
'
Debug Telemetry
'
,
timeout
:
1000
*
60
*
5
,
args
:
[
`
${
this
.
extensionDescription
.
publisher
}
.
${
this
.
type
}
`
,
JSON
.
stringify
(
data
),
this
.
debuggerContribution
.
aiKey
],
args
:
[
`
${
this
.
getMainExtensionDescriptor
()
.
publisher
}
.
${
this
.
type
}
`
,
JSON
.
stringify
(
data
),
this
.
debuggerContribution
.
aiKey
],
env
:
{
ELECTRON_RUN_AS_NODE
:
1
,
PIPE_LOGGING
:
'
true
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录