Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
ffab77a9
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ffab77a9
编写于
12月 20, 2018
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null check for some tasks files
Part of #63453
上级
6bbf94c2
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
186 addition
and
157 deletion
+186
-157
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+3
-0
src/vs/workbench/parts/tasks/common/problemMatcher.ts
src/vs/workbench/parts/tasks/common/problemMatcher.ts
+3
-3
src/vs/workbench/parts/tasks/common/tasks.ts
src/vs/workbench/parts/tasks/common/tasks.ts
+14
-10
src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.ts
...s/workbench/parts/tasks/electron-browser/jsonSchema_v1.ts
+6
-6
src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts
...s/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts
+45
-39
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
+115
-99
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
ffab77a9
...
...
@@ -674,8 +674,11 @@
"./vs/workbench/parts/tasks/common/taskSystem.ts"
,
"./vs/workbench/parts/tasks/common/taskTemplates.ts"
,
"./vs/workbench/parts/tasks/common/tasks.ts"
,
"./vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.ts"
,
"./vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts"
,
"./vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts"
,
"./vs/workbench/parts/tasks/electron-browser/runAutomaticTasks.ts"
,
"./vs/workbench/parts/tasks/node/taskConfiguration.ts"
,
"./vs/workbench/parts/tasks/node/tasks.ts"
,
"./vs/workbench/parts/tasks/test/common/problemMatcher.test.ts"
,
"./vs/workbench/parts/terminal/browser/terminalFindWidget.ts"
,
...
...
src/vs/workbench/parts/tasks/common/problemMatcher.ts
浏览文件 @
ffab77a9
...
...
@@ -146,7 +146,7 @@ export interface NamedMultiLineProblemPattern {
patterns
:
MultiLineProblemPattern
;
}
export
function
isNamedProblemMatcher
(
value
:
ProblemMatcher
):
value
is
NamedProblemMatcher
{
export
function
isNamedProblemMatcher
(
value
:
ProblemMatcher
|
undefined
):
value
is
NamedProblemMatcher
{
return
value
&&
Types
.
isString
((
<
NamedProblemMatcher
>
value
).
name
)
?
true
:
false
;
}
...
...
@@ -1286,10 +1286,10 @@ export class ProblemMatcherParser extends Parser {
super
(
logger
);
}
public
parse
(
json
:
Config
.
ProblemMatcher
):
ProblemMatcher
|
null
{
public
parse
(
json
:
Config
.
ProblemMatcher
):
ProblemMatcher
|
undefined
{
let
result
=
this
.
createProblemMatcher
(
json
);
if
(
!
this
.
checkProblemMatcherValid
(
json
,
result
))
{
return
null
;
return
undefined
;
}
this
.
addWatchingMatcher
(
json
,
result
);
...
...
src/vs/workbench/parts/tasks/common/tasks.ts
浏览文件 @
ffab77a9
...
...
@@ -218,7 +218,7 @@ export interface PresentationOptions {
export
namespace
PresentationOptions
{
export
const
defaults
:
PresentationOptions
=
{
echo
:
tru
e
,
reveal
:
RevealKind
.
Always
,
focus
:
false
,
panel
:
PanelKind
.
Shared
,
showReuseMessage
:
true
,
clear
:
false
echo
:
fals
e
,
reveal
:
RevealKind
.
Always
,
focus
:
false
,
panel
:
PanelKind
.
Shared
,
showReuseMessage
:
true
,
clear
:
false
};
}
...
...
@@ -262,12 +262,12 @@ export interface CommandConfiguration {
/**
* The task type
*/
runtime
:
RuntimeType
;
runtime
?
:
RuntimeType
;
/**
* The command to execute
*/
name
:
CommandString
;
name
?
:
CommandString
;
/**
* Additional command options.
...
...
@@ -293,7 +293,7 @@ export interface CommandConfiguration {
/**
* Describes how the task is presented in the UI.
*/
presentation
:
PresentationOptions
;
presentation
?
:
PresentationOptions
;
}
export
namespace
TaskGroup
{
...
...
@@ -372,7 +372,7 @@ export interface KeyedTaskIdentifier extends TaskIdentifier {
export
interface
TaskDependency
{
workspaceFolder
:
IWorkspaceFolder
;
task
:
string
|
KeyedTaskIdentifier
;
task
:
string
|
KeyedTaskIdentifier
|
undefined
;
}
export
const
enum
GroupType
{
...
...
@@ -469,10 +469,12 @@ export abstract class CommonTask {
private
_taskLoadMessages
:
string
[]
|
undefined
;
protected
constructor
(
id
:
string
,
label
:
string
,
type
,
runOptions
:
RunOptions
,
protected
constructor
(
id
:
string
,
label
:
string
|
undefined
,
type
,
runOptions
:
RunOptions
,
configurationProperties
:
ConfigurationProperties
,
source
:
BaseTaskSource
)
{
this
.
_id
=
id
;
this
.
_label
=
label
;
if
(
label
)
{
this
.
_label
=
label
;
}
if
(
type
)
{
this
.
type
=
type
;
}
...
...
@@ -563,12 +565,14 @@ export class CustomTask extends CommonTask {
*/
command
:
CommandConfiguration
;
public
constructor
(
id
:
string
,
source
:
WorkspaceTaskSource
,
label
:
string
,
type
,
command
:
CommandConfiguration
,
public
constructor
(
id
:
string
,
source
:
WorkspaceTaskSource
,
label
:
string
,
type
,
command
:
CommandConfiguration
|
undefined
,
hasDefinedMatchers
:
boolean
,
runOptions
:
RunOptions
,
configurationProperties
:
ConfigurationProperties
)
{
super
(
id
,
label
,
undefined
,
runOptions
,
configurationProperties
,
source
);
this
.
_source
=
source
;
this
.
hasDefinedMatchers
=
hasDefinedMatchers
;
this
.
command
=
command
;
if
(
command
)
{
this
.
command
=
command
;
}
}
public
customizes
():
KeyedTaskIdentifier
|
undefined
{
...
...
@@ -642,7 +646,7 @@ export class ConfiguringTask extends CommonTask {
configures
:
KeyedTaskIdentifier
;
public
constructor
(
id
:
string
,
source
:
WorkspaceTaskSource
,
label
:
string
,
type
,
public
constructor
(
id
:
string
,
source
:
WorkspaceTaskSource
,
label
:
string
|
undefined
,
type
,
configures
:
KeyedTaskIdentifier
,
runOptions
:
RunOptions
,
configurationProperties
:
ConfigurationProperties
)
{
super
(
id
,
label
,
type
,
runOptions
,
configurationProperties
,
source
);
this
.
_source
=
source
;
...
...
src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.ts
浏览文件 @
ffab77a9
...
...
@@ -63,10 +63,10 @@ const shellCommand: IJSONSchema = {
};
schema
.
definitions
=
Objects
.
deepClone
(
commonSchema
.
definitions
);
let
definitions
=
schema
.
definitions
;
definitions
[
'
commandConfiguration
'
][
'
properties
'
][
'
isShellCommand
'
]
=
Objects
.
deepClone
(
shellCommand
);
definitions
[
'
taskDescription
'
][
'
properties
'
][
'
isShellCommand
'
]
=
Objects
.
deepClone
(
shellCommand
);
definitions
[
'
taskRunnerConfiguration
'
][
'
properties
'
][
'
isShellCommand
'
]
=
Objects
.
deepClone
(
shellCommand
);
let
definitions
=
schema
.
definitions
!
;
definitions
[
'
commandConfiguration
'
][
'
properties
'
]
!
[
'
isShellCommand
'
]
=
Objects
.
deepClone
(
shellCommand
);
definitions
[
'
taskDescription
'
][
'
properties
'
]
!
[
'
isShellCommand
'
]
=
Objects
.
deepClone
(
shellCommand
);
definitions
[
'
taskRunnerConfiguration
'
][
'
properties
'
]
!
[
'
isShellCommand
'
]
=
Objects
.
deepClone
(
shellCommand
);
Object
.
getOwnPropertyNames
(
definitions
).
forEach
(
key
=>
{
let
newKey
=
key
+
'
1
'
;
...
...
@@ -94,8 +94,8 @@ fixReferences(schema);
ProblemMatcherRegistry
.
onReady
().
then
(()
=>
{
try
{
let
matcherIds
=
ProblemMatcherRegistry
.
keys
().
map
(
key
=>
'
$
'
+
key
);
definitions
.
problemMatcherType1
.
oneOf
[
0
].
enum
=
matcherIds
;
(
definitions
.
problemMatcherType1
.
oneOf
[
2
].
items
as
IJSONSchema
).
anyOf
[
1
].
enum
=
matcherIds
;
definitions
.
problemMatcherType1
.
oneOf
!
[
0
].
enum
=
matcherIds
;
(
definitions
.
problemMatcherType1
.
oneOf
!
[
2
].
items
as
IJSONSchema
).
anyOf
!
[
1
].
enum
=
matcherIds
;
}
catch
(
err
)
{
console
.
log
(
'
Installing problem matcher ids failed
'
);
}
...
...
src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts
浏览文件 @
ffab77a9
...
...
@@ -300,8 +300,10 @@ const runOptions: IJSONSchema = {
description
:
nls
.
localize
(
'
JsonSchema.tasks.runOptions
'
,
'
The task
\'
s run related options
'
)
};
const
options
:
IJSONSchema
=
Objects
.
deepClone
(
commonSchema
.
definitions
.
options
);
options
.
properties
.
shell
=
Objects
.
deepClone
(
commonSchema
.
definitions
.
shellConfiguration
);
const
commonSchemaDefinitions
=
commonSchema
.
definitions
!
;
const
options
:
IJSONSchema
=
Objects
.
deepClone
(
commonSchemaDefinitions
.
options
);
const
optionsProperties
=
options
.
properties
!
;
optionsProperties
.
shell
=
Objects
.
deepClone
(
commonSchemaDefinitions
.
shellConfiguration
);
let
taskConfiguration
:
IJSONSchema
=
{
type
:
'
object
'
,
...
...
@@ -342,8 +344,9 @@ let taskDefinitions: IJSONSchema[] = [];
TaskDefinitionRegistry
.
onReady
().
then
(()
=>
{
for
(
let
taskType
of
TaskDefinitionRegistry
.
all
())
{
let
schema
:
IJSONSchema
=
Objects
.
deepClone
(
taskConfiguration
);
const
schemaProperties
=
schema
.
properties
!
;
// Since we do this after the schema is assigned we need to patch the refs.
schema
.
p
roperties
.
type
=
{
schema
P
roperties
.
type
=
{
type
:
'
string
'
,
description
:
nls
.
localize
(
'
JsonSchema.customizations.customizes.type
'
,
'
The task type to customize
'
),
enum
:
[
taskType
.
taskType
]
...
...
@@ -354,7 +357,7 @@ TaskDefinitionRegistry.onReady().then(() => {
if
(
taskType
.
properties
)
{
for
(
let
key
of
Object
.
keys
(
taskType
.
properties
))
{
let
property
=
taskType
.
properties
[
key
];
schema
.
p
roperties
[
key
]
=
Objects
.
deepClone
(
property
);
schema
P
roperties
[
key
]
=
Objects
.
deepClone
(
property
);
}
}
fixReferences
(
schema
);
...
...
@@ -363,27 +366,28 @@ TaskDefinitionRegistry.onReady().then(() => {
});
let
customize
=
Objects
.
deepClone
(
taskConfiguration
);
customize
.
properties
.
customize
=
{
customize
.
properties
!
.
customize
=
{
type
:
'
string
'
,
deprecationMessage
:
nls
.
localize
(
'
JsonSchema.tasks.customize.deprecated
'
,
'
The customize property is deprecated. See the 1.14 release notes on how to migrate to the new task customization approach
'
)
};
taskDefinitions
.
push
(
customize
);
let
definitions
=
Objects
.
deepClone
(
commonSchema
.
d
efinitions
);
let
definitions
=
Objects
.
deepClone
(
commonSchema
D
efinitions
);
let
taskDescription
:
IJSONSchema
=
definitions
.
taskDescription
;
taskDescription
.
required
=
[
'
label
'
];
taskDescription
.
properties
.
label
=
Objects
.
deepClone
(
label
);
taskDescription
.
properties
.
command
=
Objects
.
deepClone
(
command
);
taskDescription
.
properties
.
args
=
Objects
.
deepClone
(
args
);
taskDescription
.
properties
.
isShellCommand
=
Objects
.
deepClone
(
shellCommand
);
taskDescription
.
properties
.
dependsOn
=
dependsOn
;
taskDescription
.
properties
.
identifier
=
Objects
.
deepClone
(
identifier
);
taskDescription
.
properties
.
type
=
Objects
.
deepClone
(
taskType
);
taskDescription
.
properties
.
presentation
=
Objects
.
deepClone
(
presentation
);
taskDescription
.
properties
.
terminal
=
terminal
;
taskDescription
.
properties
.
group
=
Objects
.
deepClone
(
group
);
taskDescription
.
properties
.
runOptions
=
Objects
.
deepClone
(
runOptions
);
taskDescription
.
properties
.
taskName
.
deprecationMessage
=
nls
.
localize
(
const
taskDescriptionProperties
=
taskDescription
.
properties
!
;
taskDescriptionProperties
.
label
=
Objects
.
deepClone
(
label
);
taskDescriptionProperties
.
command
=
Objects
.
deepClone
(
command
);
taskDescriptionProperties
.
args
=
Objects
.
deepClone
(
args
);
taskDescriptionProperties
.
isShellCommand
=
Objects
.
deepClone
(
shellCommand
);
taskDescriptionProperties
.
dependsOn
=
dependsOn
;
taskDescriptionProperties
.
identifier
=
Objects
.
deepClone
(
identifier
);
taskDescriptionProperties
.
type
=
Objects
.
deepClone
(
taskType
);
taskDescriptionProperties
.
presentation
=
Objects
.
deepClone
(
presentation
);
taskDescriptionProperties
.
terminal
=
terminal
;
taskDescriptionProperties
.
group
=
Objects
.
deepClone
(
group
);
taskDescriptionProperties
.
runOptions
=
Objects
.
deepClone
(
runOptions
);
taskDescriptionProperties
.
taskName
.
deprecationMessage
=
nls
.
localize
(
'
JsonSchema.tasks.taskName.deprecated
'
,
'
The task
\'
s name property is deprecated. Use the label property instead.
'
);
...
...
@@ -397,19 +401,19 @@ definitions.showOutputType.deprecationMessage = nls.localize(
'
JsonSchema.tasks.showOputput.deprecated
'
,
'
The property showOutput is deprecated. Use the reveal property inside the presentation property instead. See also the 1.14 release notes.
'
);
definitions
.
taskDescription
.
p
roperties
.
echoCommand
.
deprecationMessage
=
nls
.
localize
(
taskDescriptionP
roperties
.
echoCommand
.
deprecationMessage
=
nls
.
localize
(
'
JsonSchema.tasks.echoCommand.deprecated
'
,
'
The property echoCommand is deprecated. Use the echo property inside the presentation property instead. See also the 1.14 release notes.
'
);
definitions
.
taskDescription
.
p
roperties
.
suppressTaskName
.
deprecationMessage
=
nls
.
localize
(
taskDescriptionP
roperties
.
suppressTaskName
.
deprecationMessage
=
nls
.
localize
(
'
JsonSchema.tasks.suppressTaskName.deprecated
'
,
'
The property suppressTaskName is deprecated. Inline the command with its arguments into the task instead. See also the 1.14 release notes.
'
);
definitions
.
taskDescription
.
p
roperties
.
isBuildCommand
.
deprecationMessage
=
nls
.
localize
(
taskDescriptionP
roperties
.
isBuildCommand
.
deprecationMessage
=
nls
.
localize
(
'
JsonSchema.tasks.isBuildCommand.deprecated
'
,
'
The property isBuildCommand is deprecated. Use the group property instead. See also the 1.14 release notes.
'
);
definitions
.
taskDescription
.
p
roperties
.
isTestCommand
.
deprecationMessage
=
nls
.
localize
(
taskDescriptionP
roperties
.
isTestCommand
.
deprecationMessage
=
nls
.
localize
(
'
JsonSchema.tasks.isTestCommand.deprecated
'
,
'
The property isTestCommand is deprecated. Use the group property instead. See also the 1.14 release notes.
'
);
...
...
@@ -419,37 +423,38 @@ taskDefinitions.push({
$ref
:
'
#/definitions/taskDescription
'
}
as
IJSONSchema
);
let
tasks
=
definitions
.
taskRunnerConfiguration
.
properties
.
tasks
;
const
definitionsTaskRunnerConfigurationProperties
=
definitions
.
taskRunnerConfiguration
.
properties
!
;
let
tasks
=
definitionsTaskRunnerConfigurationProperties
.
tasks
;
tasks
.
items
=
{
oneOf
:
taskDefinitions
};
definitions
.
taskRunnerConfiguration
.
properties
.
inputs
=
inputsSchema
.
definitions
.
inputs
;
definitions
TaskRunnerConfigurationProperties
.
inputs
=
inputsSchema
.
definitions
!
.
inputs
;
definitions
.
commandConfiguration
.
properties
.
isShellCommand
=
Objects
.
deepClone
(
shellCommand
);
definitions
.
options
.
properties
.
shell
=
{
definitions
.
commandConfiguration
.
properties
!
.
isShellCommand
=
Objects
.
deepClone
(
shellCommand
);
definitions
.
options
.
properties
!
.
shell
=
{
$ref
:
'
#/definitions/shellConfiguration
'
};
definitions
.
taskRunnerConfiguration
.
p
roperties
.
isShellCommand
=
Objects
.
deepClone
(
shellCommand
);
definitions
.
taskRunnerConfiguration
.
p
roperties
.
type
=
Objects
.
deepClone
(
taskType
);
definitions
.
taskRunnerConfiguration
.
p
roperties
.
group
=
Objects
.
deepClone
(
group
);
definitions
.
taskRunnerConfiguration
.
p
roperties
.
presentation
=
Objects
.
deepClone
(
presentation
);
definitions
.
taskRunnerConfiguration
.
p
roperties
.
suppressTaskName
.
deprecationMessage
=
nls
.
localize
(
definitions
TaskRunnerConfigurationP
roperties
.
isShellCommand
=
Objects
.
deepClone
(
shellCommand
);
definitions
TaskRunnerConfigurationP
roperties
.
type
=
Objects
.
deepClone
(
taskType
);
definitions
TaskRunnerConfigurationP
roperties
.
group
=
Objects
.
deepClone
(
group
);
definitions
TaskRunnerConfigurationP
roperties
.
presentation
=
Objects
.
deepClone
(
presentation
);
definitions
TaskRunnerConfigurationP
roperties
.
suppressTaskName
.
deprecationMessage
=
nls
.
localize
(
'
JsonSchema.tasks.suppressTaskName.deprecated
'
,
'
The property suppressTaskName is deprecated. Inline the command with its arguments into the task instead. See also the 1.14 release notes.
'
);
definitions
.
taskRunnerConfiguration
.
p
roperties
.
taskSelector
.
deprecationMessage
=
nls
.
localize
(
definitions
TaskRunnerConfigurationP
roperties
.
taskSelector
.
deprecationMessage
=
nls
.
localize
(
'
JsonSchema.tasks.taskSelector.deprecated
'
,
'
The property taskSelector is deprecated. Inline the command with its arguments into the task instead. See also the 1.14 release notes.
'
);
let
osSpecificTaskRunnerConfiguration
=
Objects
.
deepClone
(
definitions
.
taskRunnerConfiguration
);
delete
osSpecificTaskRunnerConfiguration
.
properties
.
tasks
;
delete
osSpecificTaskRunnerConfiguration
.
properties
!
.
tasks
;
osSpecificTaskRunnerConfiguration
.
additionalProperties
=
false
;
definitions
.
osSpecificTaskRunnerConfiguration
=
osSpecificTaskRunnerConfiguration
;
definitions
.
taskRunnerConfiguration
.
p
roperties
.
version
=
Objects
.
deepClone
(
version
);
definitions
TaskRunnerConfigurationP
roperties
.
version
=
Objects
.
deepClone
(
version
);
const
schema
:
IJSONSchema
=
{
oneOf
:
[
...
...
@@ -485,9 +490,10 @@ const schema: IJSONSchema = {
schema
.
definitions
=
definitions
;
function
deprecatedVariableMessage
(
schemaMap
:
IJSONSchemaMap
,
property
:
string
)
{
if
(
schemaMap
[
property
].
properties
)
{
Object
.
keys
(
schemaMap
[
property
].
properties
).
forEach
(
name
=>
{
deprecatedVariableMessage
(
schemaMap
[
property
].
properties
,
name
);
const
mapAtProperty
=
schemaMap
[
property
].
properties
!
;
if
(
mapAtProperty
)
{
Object
.
keys
(
mapAtProperty
).
forEach
(
name
=>
{
deprecatedVariableMessage
(
mapAtProperty
,
name
);
});
}
else
{
ConfigurationResolverUtils
.
applyDeprecatedVariableMessage
(
schemaMap
[
property
]);
...
...
@@ -505,8 +511,8 @@ fixReferences(schema);
ProblemMatcherRegistry
.
onReady
().
then
(()
=>
{
try
{
let
matcherIds
=
ProblemMatcherRegistry
.
keys
().
map
(
key
=>
'
$
'
+
key
);
definitions
.
problemMatcherType2
.
oneOf
[
0
].
enum
=
matcherIds
;
(
definitions
.
problemMatcherType2
.
oneOf
[
2
].
items
as
IJSONSchema
).
anyOf
[
1
].
enum
=
matcherIds
;
definitions
.
problemMatcherType2
.
oneOf
!
[
0
].
enum
=
matcherIds
;
(
definitions
.
problemMatcherType2
.
oneOf
!
[
2
].
items
as
IJSONSchema
).
anyOf
!
[
1
].
enum
=
matcherIds
;
}
catch
(
err
)
{
console
.
log
(
'
Installing problem matcher ids failed
'
);
}
...
...
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
浏览文件 @
ffab77a9
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录