Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e58c2abb
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,发现更多精彩内容 >>
提交
e58c2abb
编写于
5月 29, 2017
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implements #27399: Separate the task provider name from the task name in the task API
上级
7c3f873b
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
88 addition
and
50 deletion
+88
-50
extensions/grunt/src/main.ts
extensions/grunt/src/main.ts
+2
-2
extensions/gulp/src/main.ts
extensions/gulp/src/main.ts
+1
-1
extensions/jake/src/main.ts
extensions/jake/src/main.ts
+1
-1
extensions/npm/src/main.ts
extensions/npm/src/main.ts
+2
-2
extensions/typescript/src/features/taskProvider.ts
extensions/typescript/src/features/taskProvider.ts
+2
-1
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+22
-11
src/vs/workbench/api/node/extHostTask.ts
src/vs/workbench/api/node/extHostTask.ts
+5
-1
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+33
-25
src/vs/workbench/parts/tasks/browser/quickOpen.ts
src/vs/workbench/parts/tasks/browser/quickOpen.ts
+14
-2
src/vs/workbench/parts/tasks/common/taskConfiguration.ts
src/vs/workbench/parts/tasks/common/taskConfiguration.ts
+1
-0
src/vs/workbench/parts/tasks/common/tasks.ts
src/vs/workbench/parts/tasks/common/tasks.ts
+3
-2
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
...rkbench/parts/tasks/electron-browser/task.contribution.ts
+1
-1
src/vs/workbench/parts/tasks/test/node/configuration.test.ts
src/vs/workbench/parts/tasks/test/node/configuration.test.ts
+1
-1
未找到文件。
extensions/grunt/src/main.ts
浏览文件 @
e58c2abb
...
...
@@ -139,8 +139,8 @@ async function getGruntTasks(): Promise<vscode.Task[]> {
if
(
matches
&&
matches
.
length
===
2
)
{
let
taskName
=
matches
[
1
];
let
task
=
taskName
.
indexOf
(
'
'
)
===
-
1
?
new
vscode
.
ShellTask
(
`grunt:
${
taskName
}
`
,
`
${
command
}
${
taskName
}
`
)
:
new
vscode
.
ShellTask
(
`grunt:
${
taskName
}
`
,
`
${
command
}
"
${
taskName
}
"`
);
?
new
vscode
.
ShellTask
(
taskName
,
`
${
command
}
${
taskName
}
`
)
:
new
vscode
.
ShellTask
(
taskName
,
`
${
command
}
"
${
taskName
}
"`
);
task
.
identifier
=
`grunt.
${
taskName
}
`
;
result
.
push
(
task
);
let
lowerCaseTaskName
=
taskName
.
toLowerCase
();
...
...
extensions/gulp/src/main.ts
浏览文件 @
e58c2abb
...
...
@@ -114,7 +114,7 @@ async function getGulpTasks(): Promise<vscode.Task[]> {
if
(
line
.
length
===
0
)
{
continue
;
}
let
task
=
new
vscode
.
ShellTask
(
`gulp:
${
line
}
`
,
`
${
gulpCommand
}
${
line
}
`
);
let
task
=
new
vscode
.
ShellTask
(
line
,
`
${
gulpCommand
}
${
line
}
`
);
task
.
identifier
=
`gulp.
${
line
}
`
;
result
.
push
(
task
);
let
lowerCaseLine
=
line
.
toLowerCase
();
...
...
extensions/jake/src/main.ts
浏览文件 @
e58c2abb
...
...
@@ -118,7 +118,7 @@ async function getJakeTasks(): Promise<vscode.Task[]> {
let
matches
=
regExp
.
exec
(
line
);
if
(
matches
&&
matches
.
length
===
2
)
{
let
taskName
=
matches
[
1
];
let
task
=
new
vscode
.
ShellTask
(
`jake:
${
taskName
}
`
,
`
${
jakeCommand
}
${
taskName
}
`
);
let
task
=
new
vscode
.
ShellTask
(
taskName
,
`
${
jakeCommand
}
${
taskName
}
`
);
task
.
identifier
=
`jake.
${
taskName
}
`
;
result
.
push
(
task
);
let
lowerCaseLine
=
line
.
toLowerCase
();
...
...
extensions/npm/src/main.ts
浏览文件 @
e58c2abb
...
...
@@ -81,7 +81,7 @@ async function getNpmScriptsAsTasks(): Promise<vscode.Task[]> {
const
result
:
vscode
.
Task
[]
=
[];
Object
.
keys
(
json
.
scripts
).
forEach
(
each
=>
{
const
task
=
new
vscode
.
ShellTask
(
`
npm:
run
${
each
}
`
,
`npm run
${
each
}
`
);
const
task
=
new
vscode
.
ShellTask
(
`run
${
each
}
`
,
`npm run
${
each
}
`
);
const
lowerCaseTaskName
=
each
.
toLowerCase
();
if
(
lowerCaseTaskName
===
'
build
'
)
{
task
.
group
=
vscode
.
TaskGroup
.
Build
;
...
...
@@ -91,7 +91,7 @@ async function getNpmScriptsAsTasks(): Promise<vscode.Task[]> {
result
.
push
(
task
);
});
// add some 'well known' npm tasks
result
.
push
(
new
vscode
.
ShellTask
(
`
npm:
install`
,
`npm install`
));
result
.
push
(
new
vscode
.
ShellTask
(
`install`
,
`npm install`
));
return
Promise
.
resolve
(
result
);
}
catch
(
e
)
{
return
Promise
.
resolve
(
emptyTasks
);
...
...
extensions/typescript/src/features/taskProvider.ts
浏览文件 @
e58c2abb
...
...
@@ -48,7 +48,8 @@ class TscTaskProvider implements vscode.TaskProvider {
return
projects
.
map
(
configFile
=>
{
const
configFileName
=
path
.
relative
(
rootPath
,
configFile
);
const
buildTask
=
new
vscode
.
ShellTask
(
`tsc: build
${
configFileName
}
`
,
`
${
command
}
-p "
${
configFile
}
"`
,
'
$tsc
'
);
const
buildTask
=
new
vscode
.
ShellTask
(
`build
${
configFileName
}
`
,
`
${
command
}
-p "
${
configFile
}
"`
,
'
$tsc
'
);
buildTask
.
source
=
'
tsc
'
;
buildTask
.
group
=
vscode
.
TaskGroup
.
Build
;
return
buildTask
;
});
...
...
src/vs/vscode.d.ts
浏览文件 @
e58c2abb
...
...
@@ -3580,11 +3580,6 @@ declare module 'vscode' {
export
const
Test
:
'
test
'
;
}
/**
* The supported task groups.
*/
export
type
TaskGroup
=
'
clean
'
|
'
build
'
|
'
rebuildAll
'
|
'
test
'
;
/**
* The ProblemMatchers type definition.
*/
...
...
@@ -3652,10 +3647,18 @@ declare module 'vscode' {
args
:
string
[];
/**
*
The task group this tasks belongs to. Defaults to undefined meaning
*
that the task doesn't belong to any special group
.
*
A human-readable string describing the source of this
*
shell task, e.g. 'gulp' or 'npm'
.
*/
group
?:
TaskGroup
;
source
:
string
|
undefined
;
/**
* The task group this tasks belongs to. See TaskGroup
* for a predefined set of available groups.
* Defaults to undefined meaning that the task doesn't
* belong to any special group.
*/
group
:
string
|
undefined
;
/**
* The process options used when the process is executed.
...
...
@@ -3772,10 +3775,18 @@ declare module 'vscode' {
readonly
commandLine
:
string
;
/**
* The task group this tasks belongs to. Defaults to undefined meaning
* that the task doesn't belong to any special group.
* A human-readable string describing the source of this
* shell task, e.g. 'gulp' or 'npm'.
*/
source
:
string
|
undefined
;
/**
* The task group this tasks belongs to. See TaskGroup
* for a predefined set of available groups.
* Defaults to undefined meaning that the task doesn't
* belong to any special group.
*/
group
?:
TaskGroup
;
group
:
string
|
undefined
;
/**
* The shell options used when the shell is executed. Defaults to an
...
...
src/vs/workbench/api/node/extHostTask.ts
浏览文件 @
e58c2abb
...
...
@@ -310,7 +310,11 @@ namespace Tasks {
}
let
result
:
TaskSystem
.
Task
=
{
_id
:
uuidMap
.
getUUID
(
task
.
identifier
),
_source
:
{
kind
:
TaskSystem
.
TaskSourceKind
.
Extension
,
detail
:
extension
.
id
},
_source
:
{
kind
:
TaskSystem
.
TaskSourceKind
.
Extension
,
label
:
typeof
task
.
source
===
'
string
'
?
task
.
source
:
extension
.
name
,
detail
:
extension
.
id
},
name
:
task
.
name
,
identifier
:
task
.
identifier
,
group
:
types
.
TaskGroup
.
is
(
task
.
group
)
?
task
.
group
:
undefined
,
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
e58c2abb
...
...
@@ -1021,6 +1021,8 @@ export class BaseTask {
private
_problemMatchers
:
string
[];
private
_identifier
:
string
;
private
_isBackground
:
boolean
;
private
_source
:
string
;
private
_group
:
string
;
private
_terminal
:
vscode
.
TerminalBehaviour
;
constructor
(
name
:
string
,
problemMatchers
:
string
[])
{
...
...
@@ -1063,6 +1065,36 @@ export class BaseTask {
this
.
_isBackground
=
value
;
}
get
source
():
string
{
return
this
.
_source
;
}
set
source
(
value
:
string
)
{
if
(
value
===
void
0
||
value
===
null
)
{
this
.
_source
=
undefined
;
return
;
}
if
(
typeof
value
!==
'
string
'
||
value
.
length
===
0
)
{
throw
illegalArgument
(
'
source must be a string of length > 0
'
);
}
this
.
_source
=
value
;
}
get
group
():
string
{
return
this
.
_group
;
}
set
group
(
value
:
string
)
{
if
(
value
===
void
0
||
value
===
null
)
{
this
.
_group
=
undefined
;
return
;
}
if
(
typeof
value
!==
'
string
'
||
value
.
length
===
0
)
{
throw
illegalArgument
(
'
group must be a string of length > 0
'
);
}
this
.
_group
=
value
;
}
get
terminal
():
vscode
.
TerminalBehaviour
{
return
this
.
_terminal
;
}
...
...
@@ -1122,7 +1154,7 @@ export namespace TaskGroup {
*/
export
const
Test
:
'
test
'
=
'
test
'
;
export
function
is
(
value
:
string
):
value
is
vscode
.
TaskGroup
{
export
function
is
(
value
:
string
):
value
is
string
{
return
value
===
Clean
||
value
===
Build
||
value
===
RebuildAll
||
value
===
Test
;
}
}
...
...
@@ -1131,7 +1163,6 @@ export class ProcessTask extends BaseTask {
private
_process
:
string
;
private
_args
:
string
[];
private
_group
:
vscode
.
TaskGroup
;
private
_options
:
vscode
.
ProcessOptions
;
constructor
(
name
:
string
,
process
:
string
,
args
?:
string
[],
problemMatchers
?:
vscode
.
ProblemMatchers
);
...
...
@@ -1183,17 +1214,6 @@ export class ProcessTask extends BaseTask {
this
.
_args
=
value
;
}
get
group
():
vscode
.
TaskGroup
{
return
this
.
_group
;
}
set
group
(
value
:
vscode
.
TaskGroup
)
{
if
(
!
TaskGroup
.
is
(
value
))
{
throw
illegalArgument
(
'
group
'
);
}
this
.
_group
=
value
;
}
get
options
():
vscode
.
ProcessOptions
{
return
this
.
_options
;
}
...
...
@@ -1209,7 +1229,6 @@ export class ProcessTask extends BaseTask {
export
class
ShellTask
extends
BaseTask
implements
vscode
.
ShellTask
{
private
_commandLine
:
string
;
private
_group
:
vscode
.
TaskGroup
;
private
_options
:
vscode
.
ShellOptions
;
constructor
(
name
:
string
,
commandLine
:
string
,
problemMatchers
?:
vscode
.
ProblemMatchers
);
...
...
@@ -1240,17 +1259,6 @@ export class ShellTask extends BaseTask implements vscode.ShellTask {
return
this
.
_commandLine
;
}
get
group
():
vscode
.
TaskGroup
{
return
this
.
_group
;
}
set
group
(
value
:
vscode
.
TaskGroup
)
{
if
(
!
TaskGroup
.
is
(
value
))
{
throw
illegalArgument
(
'
group
'
);
}
this
.
_group
=
value
;
}
get
options
():
vscode
.
ShellOptions
{
return
this
.
_options
;
}
...
...
src/vs/workbench/parts/tasks/browser/quickOpen.ts
浏览文件 @
e58c2abb
...
...
@@ -19,13 +19,19 @@ import { ActionBarContributor, ContributableActionProvider } from 'vs/workbench/
export
class
TaskEntry
extends
Model
.
QuickOpenEntry
{
private
_label
:
string
;
constructor
(
protected
taskService
:
ITaskService
,
protected
_task
:
Task
,
highlights
:
Model
.
IHighlight
[]
=
[])
{
super
(
highlights
);
this
.
_task
=
_task
;
if
(
_task
.
_source
.
kind
===
TaskSourceKind
.
Extension
)
{
this
.
_label
=
nls
.
localize
(
'
taskEntry.label
'
,
'
{0}: {1}
'
,
_task
.
_source
.
label
,
_task
.
name
);
}
else
{
this
.
_label
=
_task
.
name
;
}
}
public
getLabel
():
string
{
return
this
.
_
task
.
name
;
return
this
.
_
label
;
}
public
getAriaLabel
():
string
{
...
...
@@ -76,6 +82,12 @@ export abstract class QuickOpenHandler extends Quickopen.QuickOpenHandler {
let
aKind
=
a
.
_source
.
kind
;
let
bKind
=
b
.
_source
.
kind
;
if
(
aKind
===
bKind
)
{
if
(
aKind
===
TaskSourceKind
.
Extension
)
{
let
compare
=
a
.
_source
.
label
.
localeCompare
(
b
.
_source
.
label
);
if
(
compare
!==
0
)
{
return
compare
;
}
}
return
a
.
name
.
localeCompare
(
b
.
name
);
}
if
(
aKind
===
TaskSourceKind
.
Workspace
)
{
...
...
src/vs/workbench/parts/tasks/common/taskConfiguration.ts
浏览文件 @
e58c2abb
...
...
@@ -764,6 +764,7 @@ namespace TaskDescription {
export
let
source
:
Tasks
.
TaskSource
=
{
kind
:
Tasks
.
TaskSourceKind
.
Workspace
,
label
:
'
Workspace
'
,
detail
:
'
.settins
\t
asks.json
'
};
...
...
src/vs/workbench/parts/tasks/common/tasks.ts
浏览文件 @
e58c2abb
...
...
@@ -153,7 +153,7 @@ export namespace TaskGroup {
export
const
Test
:
'
test
'
=
'
test
'
;
export
function
is
(
value
:
string
):
value
is
TaskGroup
{
export
function
is
(
value
:
string
):
value
is
string
{
return
value
===
Clean
||
value
===
Build
||
value
===
RebuildAll
||
value
===
Test
;
}
}
...
...
@@ -168,6 +168,7 @@ export enum TaskSourceKind {
export
interface
TaskSource
{
kind
:
TaskSourceKind
;
label
:
string
;
detail
?:
string
;
}
...
...
@@ -199,7 +200,7 @@ export interface Task {
/**
* the task's group;
*/
group
?:
TaskGroup
;
group
?:
string
;
/**
* The command configuration
...
...
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
浏览文件 @
e58c2abb
...
...
@@ -780,7 +780,7 @@ class TaskService extends EventEmitter implements ITaskService {
let
id
:
string
=
UUID
.
generateUuid
();
let
task
:
Task
=
{
_id
:
id
,
_source
:
{
kind
:
TaskSourceKind
.
Generic
},
_source
:
{
kind
:
TaskSourceKind
.
Generic
,
label
:
'
generic
'
},
name
:
id
,
identifier
:
id
,
dependsOn
:
extensionTasks
.
map
(
task
=>
task
.
_id
),
...
...
src/vs/workbench/parts/tasks/test/node/configuration.test.ts
浏览文件 @
e58c2abb
...
...
@@ -144,7 +144,7 @@ class TaskBuilder {
this
.
commandBuilder
=
new
CommandConfigurationBuilder
(
this
,
command
);
this
.
result
=
{
_id
:
name
,
_source
:
{
kind
:
Tasks
.
TaskSourceKind
.
Workspace
},
_source
:
{
kind
:
Tasks
.
TaskSourceKind
.
Workspace
,
label
:
'
workspace
'
},
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录