Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
872cbd7d
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,发现更多精彩内容 >>
未验证
提交
872cbd7d
编写于
11月 07, 2018
作者:
A
Alex Ross
提交者:
GitHub
11月 07, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
'custom' task type should be '$customized' to conform to API doc (#62710)
Fixes #48835
上级
cfd2ea16
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
11 deletion
+13
-11
src/vs/workbench/parts/tasks/common/tasks.ts
src/vs/workbench/parts/tasks/common/tasks.ts
+5
-3
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
+7
-7
src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts
...h/parts/tasks/test/electron-browser/configuration.test.ts
+1
-1
未找到文件。
src/vs/workbench/parts/tasks/common/tasks.ts
浏览文件 @
872cbd7d
...
...
@@ -32,6 +32,8 @@ export enum ShellQuoting {
Weak
=
3
,
}
export
const
CUSTOMIZED_TASK_TYPE
=
'
$customized
'
;
export
namespace
ShellQuoting
{
export
function
from
(
this
:
void
,
value
:
string
):
ShellQuoting
{
if
(
!
value
)
{
...
...
@@ -436,7 +438,7 @@ export interface CommonTask {
export
interface
CustomTask
extends
CommonTask
,
ConfigurationProperties
{
type
:
'
custom
'
;
type
:
'
$customized
'
;
// CUSTOMIZED_TASK_TYPE
/**
* Indicated the source of the task (e.g tasks.json or extension)
...
...
@@ -458,7 +460,7 @@ export interface CustomTask extends CommonTask, ConfigurationProperties {
export
namespace
CustomTask
{
export
function
is
(
value
:
any
):
value
is
CustomTask
{
let
candidate
:
CustomTask
=
value
;
return
candidate
&&
candidate
.
type
===
'
custom
'
;
return
candidate
&&
candidate
.
type
===
CUSTOMIZED_TASK_TYPE
;
}
export
function
getDefinition
(
task
:
CustomTask
):
KeyedTaskIdentifier
{
let
type
:
string
;
...
...
@@ -564,7 +566,7 @@ export namespace Task {
if
(
!
workspaceFolder
)
{
return
undefined
;
}
let
key
:
CustomKey
=
{
type
:
'
custom
'
,
folder
:
workspaceFolder
.
uri
.
toString
(),
id
:
task
.
identifier
};
let
key
:
CustomKey
=
{
type
:
CUSTOMIZED_TASK_TYPE
,
folder
:
workspaceFolder
.
uri
.
toString
(),
id
:
task
.
identifier
};
return
JSON
.
stringify
(
key
);
}
if
(
ContributedTask
.
is
(
task
))
{
...
...
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
浏览文件 @
872cbd7d
...
...
@@ -317,7 +317,7 @@ export interface ConfigurationProperties {
export
interface
CustomTask
extends
CommandProperties
,
ConfigurationProperties
{
/**
* Custom tasks have the type
'custom'
* Custom tasks have the type
CUSTOMIZED_TASK_TYPE
*/
type
?:
string
;
...
...
@@ -1321,9 +1321,9 @@ namespace CustomTask {
}
let
type
=
external
.
type
;
if
(
type
===
void
0
||
type
===
null
)
{
type
=
'
custom
'
;
type
=
Tasks
.
CUSTOMIZED_TASK_TYPE
;
}
if
(
type
!==
'
custom
'
&&
type
!==
'
shell
'
&&
type
!==
'
process
'
)
{
if
(
type
!==
Tasks
.
CUSTOMIZED_TASK_TYPE
&&
type
!==
'
shell
'
&&
type
!==
'
process
'
)
{
context
.
problemReporter
.
error
(
nls
.
localize
(
'
ConfigurationParser.notCustom
'
,
'
Error: tasks is not declared as a custom task. The configuration will be ignored.
\n
{0}
\n
'
,
JSON
.
stringify
(
external
,
null
,
4
)));
return
undefined
;
}
...
...
@@ -1337,7 +1337,7 @@ namespace CustomTask {
}
let
result
:
Tasks
.
CustomTask
=
{
type
:
'
custom
'
,
type
:
Tasks
.
CUSTOMIZED_TASK_TYPE
,
_id
:
context
.
uuidMap
.
getUUID
(
taskName
),
_source
:
Objects
.
assign
({},
source
,
{
config
:
{
index
,
element
:
external
,
file
:
'
.vscode
\\
tasks.json
'
,
workspaceFolder
:
context
.
workspaceFolder
}
}),
_label
:
taskName
,
...
...
@@ -1413,7 +1413,7 @@ namespace CustomTask {
_id
:
configuredProps
.
_id
,
_source
:
Objects
.
assign
({},
configuredProps
.
_source
,
{
customizes
:
contributedTask
.
defines
}),
_label
:
configuredProps
.
name
||
contributedTask
.
_label
,
type
:
'
custom
'
,
type
:
Tasks
.
CUSTOMIZED_TASK_TYPE
,
command
:
contributedTask
.
command
,
name
:
configuredProps
.
name
||
contributedTask
.
name
,
identifier
:
configuredProps
.
identifier
||
contributedTask
.
identifier
,
...
...
@@ -1460,7 +1460,7 @@ namespace TaskParser {
function
isCustomTask
(
value
:
CustomTask
|
ConfiguringTask
):
value
is
CustomTask
{
let
type
=
value
.
type
;
let
customize
=
(
value
as
any
).
customize
;
return
customize
===
void
0
&&
(
type
===
void
0
||
type
===
null
||
type
===
'
custom
'
||
type
===
'
shell
'
||
type
===
'
process
'
);
return
customize
===
void
0
&&
(
type
===
void
0
||
type
===
null
||
type
===
Tasks
.
CUSTOMIZED_TASK_TYPE
||
type
===
'
shell
'
||
type
===
'
process
'
);
}
export
function
from
(
this
:
void
,
externals
:
(
CustomTask
|
ConfiguringTask
)[],
globals
:
Globals
,
context
:
ParseContext
):
TaskParseResult
{
...
...
@@ -1839,7 +1839,7 @@ class ConfigurationParser {
_id
:
context
.
uuidMap
.
getUUID
(
name
),
_source
:
Objects
.
assign
({},
source
,
{
config
:
{
index
:
-
1
,
element
:
fileConfig
,
workspaceFolder
:
context
.
workspaceFolder
}
}),
_label
:
name
,
type
:
'
custom
'
,
type
:
Tasks
.
CUSTOMIZED_TASK_TYPE
,
name
:
name
,
identifier
:
name
,
group
:
Tasks
.
TaskGroup
.
Build
,
...
...
src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts
浏览文件 @
872cbd7d
...
...
@@ -185,7 +185,7 @@ class CustomTaskBuilder {
_id
:
name
,
_source
:
{
kind
:
Tasks
.
TaskSourceKind
.
Workspace
,
label
:
'
workspace
'
,
config
:
{
workspaceFolder
:
workspaceFolder
,
element
:
undefined
,
index
:
-
1
,
file
:
'
.vscode/tasks.json
'
}
},
_label
:
name
,
type
:
'
custom
'
,
type
:
Tasks
.
CUSTOMIZED_TASK_TYPE
,
identifier
:
name
,
name
:
name
,
command
:
this
.
commandBuilder
.
result
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录