Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
63f9e09b
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,发现更多精彩内容 >>
提交
63f9e09b
编写于
11月 23, 2018
作者:
D
Dirk Bäumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null checks for Task in extHostTypes
上级
f6f4f80c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
56 addition
and
36 deletion
+56
-36
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+1
-0
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+5
-5
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+1
-1
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+49
-30
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
63f9e09b
...
...
@@ -549,6 +549,7 @@
"./vs/vscode.d.ts"
,
"./vs/vscode.proposed.d.ts"
,
"./vs/workbench/api/node/extHostExtensionActivator.ts"
,
"./vs/workbench/api/node/extHostTypes.ts"
,
"./vs/workbench/api/shared/tasks.ts"
,
"./vs/workbench/browser/actions/toggleActivityBarVisibility.ts"
,
"./vs/workbench/browser/actions/toggleCenteredLayout.ts"
,
...
...
src/vs/vscode.d.ts
浏览文件 @
63f9e09b
...
...
@@ -5017,7 +5017,7 @@ declare module 'vscode' {
* Creates a new task.
*
* @param definition The task definition as defined in the taskDefinitions extension point.
* @param
target Specifies the task's target
. It is either a global or a workspace task or a task for a specific workspace folder.
* @param
scope Specifies the task's scope
. It is either a global or a workspace task or a task for a specific workspace folder.
* @param name The task's name. Is presented in the user interface.
* @param source The task's source (e.g. 'gulp', 'npm', ...). Is presented in the user interface.
* @param execution The process or shell execution.
...
...
@@ -5025,12 +5025,12 @@ declare module 'vscode' {
* or '$eslint'. Problem matchers can be contributed by an extension using
* the `problemMatchers` extension point.
*/
constructor
(
taskDefinition
:
TaskDefinition
,
target
:
WorkspaceFolder
|
TaskScope
.
Global
|
TaskScope
.
Workspace
,
name
:
string
,
source
:
string
,
execution
?:
ProcessExecution
|
ShellExecution
,
problemMatchers
?:
string
|
string
[]);
constructor
(
taskDefinition
:
TaskDefinition
,
scope
:
WorkspaceFolder
|
TaskScope
.
Global
|
TaskScope
.
Workspace
,
name
:
string
,
source
:
string
,
execution
?:
ProcessExecution
|
ShellExecution
,
problemMatchers
?:
string
|
string
[]);
/**
* ~~Creates a new task.~~
*
* @deprecated Use the new constructors that allow specifying a
target
for the task.
* @deprecated Use the new constructors that allow specifying a
scope
for the task.
*
* @param definition The task definition as defined in the taskDefinitions extension point.
* @param name The task's name. Is presented in the user interface.
...
...
@@ -5050,7 +5050,7 @@ declare module 'vscode' {
/**
* The task's scope.
*/
scope
?:
TaskScope
.
Global
|
TaskScope
.
Workspace
|
WorkspaceFolder
;
readonly
scope
?:
TaskScope
.
Global
|
TaskScope
.
Workspace
|
WorkspaceFolder
;
/**
* The task's name
...
...
@@ -5060,7 +5060,7 @@ declare module 'vscode' {
/**
* The task's execution engine
*/
execution
:
ProcessExecution
|
ShellExecution
;
execution
?
:
ProcessExecution
|
ShellExecution
;
/**
* Whether the task is a background task or not.
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
63f9e09b
...
...
@@ -1264,7 +1264,7 @@ declare module 'vscode' {
*/
export
class
Task2
extends
Task
{
/**
* Run options for the task
* Run options for the task
. Defaults to an empty literal.
*/
runOptions
:
RunOptions
;
}
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
63f9e09b
...
...
@@ -1427,7 +1427,7 @@ export class ProcessExecution implements vscode.ProcessExecution {
private
_process
:
string
;
private
_args
:
string
[];
private
_options
:
vscode
.
ProcessExecutionOptions
;
private
_options
:
vscode
.
ProcessExecutionOptions
|
undefined
;
constructor
(
process
:
string
,
options
?:
vscode
.
ProcessExecutionOptions
);
constructor
(
process
:
string
,
args
:
string
[],
options
?:
vscode
.
ProcessExecutionOptions
);
...
...
@@ -1472,11 +1472,11 @@ export class ProcessExecution implements vscode.ProcessExecution {
this
.
_args
=
value
;
}
get
options
():
vscode
.
ProcessExecutionOptions
{
get
options
():
vscode
.
ProcessExecutionOptions
|
undefined
{
return
this
.
_options
;
}
set
options
(
value
:
vscode
.
ProcessExecutionOptions
)
{
set
options
(
value
:
vscode
.
ProcessExecutionOptions
|
undefined
)
{
this
.
_options
=
value
;
}
...
...
@@ -1500,7 +1500,7 @@ export class ShellExecution implements vscode.ShellExecution {
private
_commandLine
:
string
;
private
_command
:
string
|
vscode
.
ShellQuotedString
;
private
_args
:
(
string
|
vscode
.
ShellQuotedString
)[];
private
_options
:
vscode
.
ShellExecutionOptions
;
private
_options
:
vscode
.
ShellExecutionOptions
|
undefined
;
constructor
(
commandLine
:
string
,
options
?:
vscode
.
ShellExecutionOptions
);
constructor
(
command
:
string
|
vscode
.
ShellQuotedString
,
args
:
(
string
|
vscode
.
ShellQuotedString
)[],
options
?:
vscode
.
ShellExecutionOptions
);
...
...
@@ -1554,11 +1554,11 @@ export class ShellExecution implements vscode.ShellExecution {
this
.
_args
=
value
||
[];
}
get
options
():
vscode
.
ShellExecutionOptions
{
get
options
():
vscode
.
ShellExecutionOptions
|
undefined
{
return
this
.
_options
;
}
set
options
(
value
:
vscode
.
ShellExecutionOptions
)
{
set
options
(
value
:
vscode
.
ShellExecutionOptions
|
undefined
)
{
this
.
_options
=
value
;
}
...
...
@@ -1598,17 +1598,21 @@ export enum RerunBehavior {
export
class
Task
implements
vscode
.
Task2
{
private
__id
:
string
;
private
static
ProcessType
:
string
=
'
process
'
;
private
static
ShellType
:
string
=
'
shell
'
;
private
static
EmptyType
:
string
=
'
$empty
'
;
private
__id
:
string
|
undefined
;
private
_definition
:
vscode
.
TaskDefinition
;
private
_scope
:
vscode
.
TaskScope
.
Global
|
vscode
.
TaskScope
.
Workspace
|
vscode
.
WorkspaceFolder
;
private
_scope
:
vscode
.
TaskScope
.
Global
|
vscode
.
TaskScope
.
Workspace
|
vscode
.
WorkspaceFolder
|
undefined
;
private
_name
:
string
;
private
_execution
:
ProcessExecution
|
ShellExecution
;
private
_execution
:
ProcessExecution
|
ShellExecution
|
undefined
;
private
_problemMatchers
:
string
[];
private
_hasDefinedMatchers
:
boolean
;
private
_isBackground
:
boolean
;
private
_source
:
string
;
private
_group
:
TaskGroup
;
private
_group
:
TaskGroup
|
undefined
;
private
_presentationOptions
:
vscode
.
TaskPresentationOptions
;
private
_runOptions
:
vscode
.
RunOptions
;
...
...
@@ -1646,13 +1650,15 @@ export class Task implements vscode.Task2 {
this
.
_hasDefinedMatchers
=
false
;
}
this
.
_isBackground
=
false
;
this
.
_presentationOptions
=
Object
.
create
(
null
);
this
.
_runOptions
=
Object
.
create
(
null
);
}
get
_id
():
string
{
get
_id
():
string
|
undefined
{
return
this
.
__id
;
}
set
_id
(
value
:
string
)
{
set
_id
(
value
:
string
|
undefined
)
{
this
.
__id
=
value
;
}
...
...
@@ -1662,17 +1668,25 @@ export class Task implements vscode.Task2 {
}
this
.
__id
=
undefined
;
this
.
_scope
=
undefined
;
this
.
_definition
=
undefined
;
this
.
computeDefinitionBasedOnExecution
();
}
private
computeDefinitionBasedOnExecution
():
void
{
if
(
this
.
_execution
instanceof
ProcessExecution
)
{
this
.
_definition
=
{
type
:
'
process
'
,
type
:
Task
.
ProcessType
,
id
:
this
.
_execution
.
computeId
()
};
}
else
if
(
this
.
_execution
instanceof
ShellExecution
)
{
this
.
_definition
=
{
type
:
'
shell
'
,
type
:
Task
.
ShellType
,
id
:
this
.
_execution
.
computeId
()
};
}
else
{
this
.
_definition
=
{
type
:
Task
.
EmptyType
,
id
:
generateUuid
()
};
}
}
...
...
@@ -1688,7 +1702,7 @@ export class Task implements vscode.Task2 {
this
.
_definition
=
value
;
}
get
scope
():
vscode
.
TaskScope
.
Global
|
vscode
.
TaskScope
.
Workspace
|
vscode
.
WorkspaceFolder
{
get
scope
():
vscode
.
TaskScope
.
Global
|
vscode
.
TaskScope
.
Workspace
|
vscode
.
WorkspaceFolder
|
undefined
{
return
this
.
_scope
;
}
...
...
@@ -1709,16 +1723,20 @@ export class Task implements vscode.Task2 {
this
.
_name
=
value
;
}
get
execution
():
ProcessExecution
|
ShellExecution
{
get
execution
():
ProcessExecution
|
ShellExecution
|
undefined
{
return
this
.
_execution
;
}
set
execution
(
value
:
ProcessExecution
|
ShellExecution
)
{
set
execution
(
value
:
ProcessExecution
|
ShellExecution
|
undefined
)
{
if
(
value
===
null
)
{
value
=
undefined
;
}
this
.
clear
();
this
.
_execution
=
value
;
let
type
=
this
.
_definition
.
type
;
if
(
Task
.
EmptyType
===
type
||
Task
.
ProcessType
===
type
||
Task
.
ShellType
===
type
)
{
this
.
computeDefinitionBasedOnExecution
();
}
}
get
problemMatchers
():
string
[]
{
...
...
@@ -1727,13 +1745,15 @@ export class Task implements vscode.Task2 {
set
problemMatchers
(
value
:
string
[])
{
if
(
!
Array
.
isArray
(
value
))
{
this
.
clear
();
this
.
_problemMatchers
=
[];
this
.
_hasDefinedMatchers
=
false
;
return
;
}
else
{
this
.
clear
();
this
.
_problemMatchers
=
value
;
this
.
_hasDefinedMatchers
=
true
;
}
this
.
clear
();
this
.
_problemMatchers
=
value
;
this
.
_hasDefinedMatchers
=
true
;
}
get
hasDefinedMatchers
():
boolean
{
...
...
@@ -1764,14 +1784,13 @@ export class Task implements vscode.Task2 {
this
.
_source
=
value
;
}
get
group
():
TaskGroup
{
get
group
():
TaskGroup
|
undefined
{
return
this
.
_group
;
}
set
group
(
value
:
TaskGroup
)
{
if
(
value
===
void
0
||
value
===
null
)
{
this
.
_group
=
undefined
;
return
;
set
group
(
value
:
TaskGroup
|
undefined
)
{
if
(
value
===
null
)
{
value
=
undefined
;
}
this
.
clear
();
this
.
_group
=
value
;
...
...
@@ -1782,8 +1801,8 @@ export class Task implements vscode.Task2 {
}
set
presentationOptions
(
value
:
vscode
.
TaskPresentationOptions
)
{
if
(
value
===
null
)
{
value
=
undefined
;
if
(
value
===
null
||
value
===
undefined
)
{
value
=
Object
.
create
(
null
)
;
}
this
.
clear
();
this
.
_presentationOptions
=
value
;
...
...
@@ -1794,8 +1813,8 @@ export class Task implements vscode.Task2 {
}
set
runOptions
(
value
:
vscode
.
RunOptions
)
{
if
(
value
===
null
)
{
value
=
undefined
;
if
(
value
===
null
||
value
===
undefined
)
{
value
=
Object
.
create
(
null
)
;
}
this
.
clear
();
this
.
_runOptions
=
value
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录