Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
b6faabef
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,发现更多精彩内容 >>
提交
b6faabef
编写于
6月 28, 2017
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support group and presentation in global schema
上级
38b523c3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
89 addition
and
13 deletion
+89
-13
src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts
...s/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts
+4
-2
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
+36
-9
src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts
...h/parts/tasks/test/electron-browser/configuration.test.ts
+49
-2
未找到文件。
src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts
浏览文件 @
b6faabef
...
...
@@ -229,7 +229,7 @@ definitions.taskDescription.properties.isTestCommand.deprecationMessage = nls.lo
taskDescription
.
properties
.
type
=
Objects
.
deepClone
(
taskType
);
taskDescription
.
properties
.
presentation
=
Objects
.
deepClone
(
presentation
);
taskDescription
.
properties
.
terminal
=
terminal
;
taskDescription
.
properties
.
group
=
group
;
taskDescription
.
properties
.
group
=
Objects
.
deepClone
(
group
)
;
taskDefinitions
.
push
({
$ref
:
'
#/definitions/taskDescription
'
...
...
@@ -247,11 +247,13 @@ definitions.options.properties.shell = {
definitions
.
taskRunnerConfiguration
.
properties
.
isShellCommand
=
Objects
.
deepClone
(
shellCommand
);
definitions
.
taskRunnerConfiguration
.
properties
.
type
=
Objects
.
deepClone
(
taskType
);
definitions
.
taskRunnerConfiguration
.
properties
.
version
=
Objects
.
deepClone
(
version
);
definitions
.
taskRunnerConfiguration
.
properties
.
group
=
Objects
.
deepClone
(
group
);
definitions
.
taskRunnerConfiguration
.
properties
.
presentation
=
Objects
.
deepClone
(
presentation
);
let
osSpecificTaskRunnerConfiguration
=
Objects
.
deepClone
(
definitions
.
taskRunnerConfiguration
);
delete
osSpecificTaskRunnerConfiguration
.
properties
.
tasks
;
osSpecificTaskRunnerConfiguration
.
additionalProperties
=
false
;
definitions
.
osSpecificTaskRunnerConfiguration
=
osSpecificTaskRunnerConfiguration
;
definitions
.
taskRunnerConfiguration
.
properties
.
version
=
Objects
.
deepClone
(
version
);
const
schema
:
IJSONSchema
=
{
oneOf
:
[
...
...
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
浏览文件 @
b6faabef
...
...
@@ -311,6 +311,10 @@ export interface BaseTaskRunnerConfiguration {
*/
echoCommand
?:
boolean
;
/**
* The group
*/
group
?:
string
|
GroupKind
;
/**
* Controls the behavior of the used terminal
*/
...
...
@@ -1011,21 +1015,32 @@ const source: Tasks.TaskSource = {
detail
:
'
.settins
\\
tasks.json
'
};
namespace
ConfigurationProperties
{
namespace
GroupKind
{
export
function
from
(
this
:
void
,
external
:
GroupKind
):
[
string
,
boolean
]
{
if
(
external
===
void
0
||
!
Types
.
isString
(
external
.
kind
))
{
namespace
GroupKind
{
export
function
from
(
this
:
void
,
external
:
string
|
GroupKind
):
[
string
,
boolean
]
{
if
(
external
===
void
0
)
{
return
undefined
;
}
if
(
Types
.
isString
(
external
))
{
if
(
Tasks
.
TaskGroup
.
is
(
external
))
{
return
[
external
,
false
];
}
else
{
return
undefined
;
}
let
group
:
string
=
external
.
kind
;
let
primary
:
boolean
=
!!
external
.
isPrimary
;
return
[
group
,
primary
];
}
if
(
!
Types
.
isString
(
external
.
kind
)
||
!
Tasks
.
TaskGroup
.
is
(
external
.
kind
))
{
return
undefined
;
}
let
group
:
string
=
external
.
kind
;
let
primary
:
boolean
=
!!
external
.
isPrimary
;
return
[
group
,
primary
];
}
}
namespace
ConfigurationProperties
{
const
properties
:
MetaData
<
Tasks
.
ConfigurationProperties
,
any
>
[]
=
[
{
property
:
'
name
'
},
{
property
:
'
identifier
'
},
{
property
:
'
group
'
},
{
property
:
'
isBackground
'
},
{
property
:
'
promptOnClose
'
},
{
property
:
'
dependsOn
'
},
{
property
:
'
presentation
'
,
type
:
CommandConfiguration
.
PresentationOptions
},
{
property
:
'
problemMatchers
'
}
...
...
@@ -1246,6 +1261,9 @@ namespace CustomTask {
if
(
task
.
problemMatchers
===
void
0
)
{
task
.
problemMatchers
=
EMPTY_ARRAY
;
}
if
(
task
.
group
!==
void
0
&&
task
.
isPrimaryGroupEntry
===
void
0
)
{
task
.
isPrimaryGroupEntry
=
false
;
}
}
export
function
createCustomTask
(
contributedTask
:
Tasks
.
ContributedTask
,
configuredProps
:
Tasks
.
ConfigurationProperties
&
{
_id
:
string
}):
Tasks
.
CustomTask
{
...
...
@@ -1363,8 +1381,10 @@ namespace TaskParser {
}
if
(
defaultBuildTask
.
rank
>
-
1
&&
defaultBuildTask
.
rank
<
2
)
{
defaultBuildTask
.
task
.
group
=
Tasks
.
TaskGroup
.
Build
;
defaultBuildTask
.
task
.
isPrimaryGroupEntry
=
false
;
}
else
if
(
defaultTestTask
.
rank
>
-
1
&&
defaultTestTask
.
rank
<
2
)
{
defaultTestTask
.
task
.
group
=
Tasks
.
TaskGroup
.
Test
;
defaultTestTask
.
task
.
isPrimaryGroupEntry
=
false
;
}
return
result
;
...
...
@@ -1727,6 +1747,13 @@ class ConfigurationParser {
isBackground
:
isBackground
,
problemMatchers
:
matchers
};
let
value
=
GroupKind
.
from
(
fileConfig
.
group
);
if
(
value
)
{
task
.
group
=
value
[
0
];
task
.
isPrimaryGroupEntry
=
value
[
1
];
}
else
if
(
fileConfig
.
group
===
'
none
'
)
{
task
.
group
=
undefined
;
}
CustomTask
.
fillGlobals
(
task
,
globals
);
CustomTask
.
fillDefaults
(
task
,
context
);
result
.
custom
=
[
task
];
...
...
src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts
浏览文件 @
b6faabef
...
...
@@ -196,6 +196,12 @@ class CustomTaskBuilder {
public
group
(
value
:
Tasks
.
TaskGroup
):
CustomTaskBuilder
{
this
.
result
.
group
=
value
;
this
.
result
.
isPrimaryGroupEntry
=
false
;
return
this
;
}
public
isPrimary
(
value
:
boolean
):
CustomTaskBuilder
{
this
.
result
.
isPrimaryGroupEntry
=
value
;
return
this
;
}
...
...
@@ -446,8 +452,10 @@ function assertTask(actual: Tasks.Task, expected: Tasks.Task) {
assert
.
strictEqual
(
actual
.
name
,
expected
.
name
,
'
name
'
);
assertCommandConfiguration
(
actual
.
command
,
expected
.
command
);
assert
.
strictEqual
(
actual
.
isBackground
,
expected
.
isBackground
,
'
isBackground
'
);
assert
.
strictEqual
(
actual
.
promptOnClose
,
expected
.
promptOnClose
,
'
promptOnClose
'
);
assert
.
strictEqual
(
typeof
actual
.
problemMatchers
,
typeof
expected
.
problemMatchers
);
assert
.
strictEqual
(
actual
.
promptOnClose
,
expected
.
promptOnClose
,
'
promptOnClose
'
);
assert
.
strictEqual
(
actual
.
group
,
expected
.
group
,
'
group
'
);
assert
.
strictEqual
(
actual
.
isPrimaryGroupEntry
,
expected
.
isPrimaryGroupEntry
,
'
isPrimaryGroupEntry
'
);
if
(
actual
.
problemMatchers
&&
expected
.
problemMatchers
)
{
assert
.
strictEqual
(
actual
.
problemMatchers
.
length
,
expected
.
problemMatchers
.
length
);
for
(
let
i
=
0
;
i
<
actual
.
problemMatchers
.
length
;
i
++
)
{
...
...
@@ -1461,7 +1469,46 @@ suite('Tasks version 2.0.0', () => {
presentation
().
echo
(
true
);
testConfiguration
(
external
,
builder
);
});
test
(
'
Global group none
'
,
()
=>
{
let
external
:
ExternalTaskRunnerConfiguration
=
{
version
:
'
2.0.0
'
,
tasks
:
[
{
taskName
:
'
dir
'
,
command
:
'
dir
'
,
type
:
'
shell
'
,
group
:
'
none
'
}
]
};
let
builder
=
new
ConfiguationBuilder
();
builder
.
task
(
'
dir
'
,
'
dir
'
).
command
().
suppressTaskName
(
true
).
runtime
(
Tasks
.
RuntimeType
.
Shell
).
presentation
().
echo
(
true
);
testConfiguration
(
external
,
builder
);
});
test
(
'
Global group primary build
'
,
()
=>
{
let
external
:
ExternalTaskRunnerConfiguration
=
{
version
:
'
2.0.0
'
,
tasks
:
[
{
taskName
:
'
dir
'
,
command
:
'
dir
'
,
type
:
'
shell
'
,
group
:
{
kind
:
'
build
'
,
isPrimary
:
true
}
}
]
};
let
builder
=
new
ConfiguationBuilder
();
builder
.
task
(
'
dir
'
,
'
dir
'
).
group
(
Tasks
.
TaskGroup
.
Build
).
isPrimary
(
true
).
command
().
suppressTaskName
(
true
).
runtime
(
Tasks
.
RuntimeType
.
Shell
).
presentation
().
echo
(
true
);
testConfiguration
(
external
,
builder
);
});
});
suite
(
'
Bugs / regression tests
'
,
()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录