Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9a72cf08
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,发现更多精彩内容 >>
提交
9a72cf08
编写于
3月 06, 2019
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
null checking in debugger.ts
上级
b91adad1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
48 addition
and
37 deletion
+48
-37
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+1
-0
src/vs/workbench/contrib/debug/common/debug.ts
src/vs/workbench/contrib/debug/common/debug.ts
+2
-2
src/vs/workbench/contrib/debug/node/debugAdapter.ts
src/vs/workbench/contrib/debug/node/debugAdapter.ts
+17
-15
src/vs/workbench/contrib/debug/node/debugger.ts
src/vs/workbench/contrib/debug/node/debugger.ts
+28
-20
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
9a72cf08
...
...
@@ -243,6 +243,7 @@
"./vs/workbench/contrib/debug/common/debugViewModel.ts"
,
"./vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts"
,
"./vs/workbench/contrib/debug/node/debugAdapter.ts"
,
"./vs/workbench/contrib/debug/node/debugger.ts"
,
"./vs/workbench/contrib/debug/node/telemetryApp.ts"
,
"./vs/workbench/contrib/debug/test/common/debugSource.test.ts"
,
"./vs/workbench/contrib/debug/test/common/debugUtils.test.ts"
,
...
...
src/vs/workbench/contrib/debug/common/debug.ts
浏览文件 @
9a72cf08
...
...
@@ -112,7 +112,7 @@ export interface IExpression extends IReplElement, IExpressionContainer {
export
interface
IDebugger
{
createDebugAdapter
(
session
:
IDebugSession
,
outputService
:
IOutputService
):
Promise
<
IDebugAdapter
>
;
runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
):
Promise
<
number
|
undefined
>
;
getCustomTelemetryService
():
Promise
<
TelemetryService
>
;
getCustomTelemetryService
():
Promise
<
TelemetryService
|
undefined
>
;
}
export
const
enum
State
{
...
...
@@ -516,7 +516,7 @@ export interface IPlatformSpecificAdapterContribution {
}
export
interface
IDebuggerContribution
extends
IPlatformSpecificAdapterContribution
{
type
?
:
string
;
type
:
string
;
label
?:
string
;
// debug adapter executable
adapterExecutableCommand
?:
string
;
...
...
src/vs/workbench/contrib/debug/node/debugAdapter.ts
浏览文件 @
9a72cf08
...
...
@@ -435,33 +435,35 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter {
}
}
private
static
extract
(
contribution
:
IDebugg
erContribution
,
extensionFolderPath
:
string
):
IDebuggerContribution
|
undefined
{
if
(
!
c
ontribution
)
{
private
static
extract
(
platformContribution
:
IPlatformSpecificAdapt
erContribution
,
extensionFolderPath
:
string
):
IDebuggerContribution
|
undefined
{
if
(
!
platformC
ontribution
)
{
return
undefined
;
}
const
result
:
IDebuggerContribution
=
Object
.
create
(
null
);
if
(
c
ontribution
.
runtime
)
{
if
(
c
ontribution
.
runtime
.
indexOf
(
'
./
'
)
===
0
)
{
// TODO
result
.
runtime
=
path
.
join
(
extensionFolderPath
,
c
ontribution
.
runtime
);
if
(
platformC
ontribution
.
runtime
)
{
if
(
platformC
ontribution
.
runtime
.
indexOf
(
'
./
'
)
===
0
)
{
// TODO
result
.
runtime
=
path
.
join
(
extensionFolderPath
,
platformC
ontribution
.
runtime
);
}
else
{
result
.
runtime
=
c
ontribution
.
runtime
;
result
.
runtime
=
platformC
ontribution
.
runtime
;
}
}
if
(
c
ontribution
.
runtimeArgs
)
{
result
.
runtimeArgs
=
c
ontribution
.
runtimeArgs
;
if
(
platformC
ontribution
.
runtimeArgs
)
{
result
.
runtimeArgs
=
platformC
ontribution
.
runtimeArgs
;
}
if
(
c
ontribution
.
program
)
{
if
(
!
path
.
isAbsolute
(
c
ontribution
.
program
))
{
result
.
program
=
path
.
join
(
extensionFolderPath
,
c
ontribution
.
program
);
if
(
platformC
ontribution
.
program
)
{
if
(
!
path
.
isAbsolute
(
platformC
ontribution
.
program
))
{
result
.
program
=
path
.
join
(
extensionFolderPath
,
platformC
ontribution
.
program
);
}
else
{
result
.
program
=
c
ontribution
.
program
;
result
.
program
=
platformC
ontribution
.
program
;
}
}
if
(
c
ontribution
.
args
)
{
result
.
args
=
c
ontribution
.
args
;
if
(
platformC
ontribution
.
args
)
{
result
.
args
=
platformC
ontribution
.
args
;
}
const
contribution
=
platformContribution
as
IDebuggerContribution
;
if
(
contribution
.
win
)
{
result
.
win
=
ExecutableDebugAdapter
.
extract
(
contribution
.
win
,
extensionFolderPath
);
}
...
...
@@ -490,7 +492,7 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter {
const
debuggers
=
<
IDebuggerContribution
[]
>
ed
.
contributes
[
'
debuggers
'
];
if
(
debuggers
&&
debuggers
.
length
>
0
)
{
debuggers
.
filter
(
dbg
=>
typeof
dbg
.
type
===
'
string
'
&&
strings
.
equalsIgnoreCase
(
dbg
.
type
,
debugType
)).
forEach
(
dbg
=>
{
// extract relevant attributes and make the
n
absolute where needed
// extract relevant attributes and make the
m
absolute where needed
const
extractedDbg
=
ExecutableDebugAdapter
.
extract
(
dbg
,
ed
.
extensionLocation
.
fsPath
);
// merge
...
...
src/vs/workbench/contrib/debug/node/debugger.ts
浏览文件 @
9a72cf08
...
...
@@ -31,7 +31,7 @@ import { isDebuggerMainContribution } from 'vs/workbench/contrib/debug/common/de
export
class
Debugger
implements
IDebugger
{
private
debuggerContribution
:
IDebuggerContribution
=
{}
;
private
debuggerContribution
:
IDebuggerContribution
;
private
mergedExtensionDescriptions
:
IExtensionDescription
[]
=
[];
private
mainExtensionDescription
:
IExtensionDescription
|
undefined
;
...
...
@@ -42,6 +42,7 @@ export class Debugger implements IDebugger {
@
IConfigurationResolverService
private
readonly
configurationResolverService
:
IConfigurationResolverService
,
@
ITelemetryService
private
readonly
telemetryService
:
ITelemetryService
,
)
{
this
.
debuggerContribution
=
{
type
:
dbgContribution
.
type
};
this
.
merge
(
dbgContribution
,
extensionDescription
);
}
...
...
@@ -149,12 +150,15 @@ export class Debugger implements IDebugger {
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
:
{
command
:
string
,
args
:
string
[]
})
=>
{
return
<
IAdapterDescriptor
>
{
type
:
'
executable
'
,
command
:
ae
.
command
,
args
:
ae
.
args
||
[]
};
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.
'
);
});
}
...
...
@@ -197,15 +201,15 @@ export class Debugger implements IDebugger {
return
this
.
debuggerContribution
.
type
;
}
get
variables
():
{
[
key
:
string
]:
string
}
{
get
variables
():
{
[
key
:
string
]:
string
}
|
undefined
{
return
this
.
debuggerContribution
.
variables
;
}
get
configurationSnippets
():
IJSONSchemaSnippet
[]
{
get
configurationSnippets
():
IJSONSchemaSnippet
[]
|
undefined
{
return
this
.
debuggerContribution
.
configurationSnippets
;
}
get
languages
():
string
[]
{
get
languages
():
string
[]
|
undefined
{
return
this
.
debuggerContribution
.
languages
;
}
...
...
@@ -254,8 +258,11 @@ export class Debugger implements IDebugger {
}
@
memoize
getCustomTelemetryService
():
Promise
<
TelemetryService
>
{
if
(
!
this
.
debuggerContribution
.
aiKey
)
{
getCustomTelemetryService
():
Promise
<
TelemetryService
|
undefined
>
{
const
aiKey
=
this
.
debuggerContribution
.
aiKey
;
if
(
!
aiKey
)
{
return
Promise
.
resolve
(
undefined
);
}
...
...
@@ -270,7 +277,7 @@ export class Debugger implements IDebugger {
{
serverName
:
'
Debug Telemetry
'
,
timeout
:
1000
*
60
*
5
,
args
:
[
`
${
this
.
getMainExtensionDescriptor
().
publisher
}
.
${
this
.
type
}
`
,
JSON
.
stringify
(
data
),
this
.
debuggerContribution
.
aiKey
],
args
:
[
`
${
this
.
getMainExtensionDescriptor
().
publisher
}
.
${
this
.
type
}
`
,
JSON
.
stringify
(
data
),
aiKey
],
env
:
{
ELECTRON_RUN_AS_NODE
:
1
,
PIPE_LOGGING
:
'
true
'
,
...
...
@@ -286,10 +293,12 @@ export class Debugger implements IDebugger {
});
}
getSchemaAttributes
():
IJSONSchema
[]
{
getSchemaAttributes
():
IJSONSchema
[]
|
null
{
if
(
!
this
.
debuggerContribution
.
configurationAttributes
)
{
return
null
;
}
// fill in the default configuration attributes shared by all adapters.
const
taskSchema
=
TaskDefinitionRegistry
.
getJsonSchema
();
return
Object
.
keys
(
this
.
debuggerContribution
.
configurationAttributes
).
map
(
request
=>
{
...
...
@@ -339,9 +348,9 @@ export class Debugger implements IDebugger {
};
properties
[
'
internalConsoleOptions
'
]
=
INTERNAL_CONSOLE_OPTIONS_SCHEMA
;
// Clear out windows, linux and osx fields to not have cycles inside the properties object
properties
[
'
windows
'
]
=
undefined
;
properties
[
'
osx
'
]
=
undefined
;
properties
[
'
linux
'
]
=
undefined
;
delete
properties
[
'
windows
'
]
;
delete
properties
[
'
osx
'
]
;
delete
properties
[
'
linux
'
]
;
const
osProperties
=
objects
.
deepClone
(
properties
);
properties
[
'
windows
'
]
=
{
...
...
@@ -359,11 +368,10 @@ export class Debugger implements IDebugger {
description
:
nls
.
localize
(
'
debugLinuxConfiguration
'
,
"
Linux specific launch configuration attributes.
"
),
properties
:
osProperties
};
Object
.
keys
(
attributes
.
properties
).
forEach
(
name
=>
{
Object
.
keys
(
properties
).
forEach
(
name
=>
{
// Use schema allOf property to get independent error reporting #21113
ConfigurationResolverUtils
.
applyDeprecatedVariableMessage
(
attributes
.
properties
[
name
]);
ConfigurationResolverUtils
.
applyDeprecatedVariableMessage
(
properties
[
name
]);
});
return
attributes
;
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录