Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
4d645781
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,发现更多精彩内容 >>
提交
4d645781
编写于
6月 23, 2017
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #29332: Improve workflow to assign a problem matcher to a build task.
上级
333d6581
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
151 addition
and
48 deletion
+151
-48
extensions/typescript/package.json
extensions/typescript/package.json
+2
-0
extensions/typescript/package.nls.json
extensions/typescript/package.nls.json
+3
-1
src/vs/platform/markers/common/problemMatcher.ts
src/vs/platform/markers/common/problemMatcher.ts
+58
-19
src/vs/workbench/parts/tasks/browser/buildQuickOpen.ts
src/vs/workbench/parts/tasks/browser/buildQuickOpen.ts
+10
-6
src/vs/workbench/parts/tasks/browser/quickOpen.ts
src/vs/workbench/parts/tasks/browser/quickOpen.ts
+46
-2
src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts
src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts
+6
-6
src/vs/workbench/parts/tasks/common/taskService.ts
src/vs/workbench/parts/tasks/common/taskService.ts
+1
-1
src/vs/workbench/parts/tasks/common/tasks.ts
src/vs/workbench/parts/tasks/common/tasks.ts
+4
-0
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
...rkbench/parts/tasks/electron-browser/task.contribution.ts
+20
-9
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
+1
-4
未找到文件。
extensions/typescript/package.json
浏览文件 @
4d645781
...
...
@@ -484,6 +484,7 @@
"problemMatchers"
:
[
{
"name"
:
"tsc"
,
"label"
:
"%typescript.problemMatchers.tsc.label%"
,
"owner"
:
"typescript"
,
"applyTo"
:
"closedDocuments"
,
"fileLocation"
:
[
...
...
@@ -494,6 +495,7 @@
},
{
"name"
:
"tsc-watch"
,
"label"
:
"%typescript.problemMatchers.tscWatch.label%"
,
"owner"
:
"typescript"
,
"applyTo"
:
"closedDocuments"
,
"fileLocation"
:
[
...
...
extensions/typescript/package.nls.json
浏览文件 @
4d645781
...
...
@@ -39,5 +39,7 @@
"typescript.npm"
:
"Specifies the path to the NPM executable used for Automatic Type Acquisition. Requires TypeScript >= 2.3.4."
,
"typescript.check.npmIsInstalled"
:
"Check if NPM is installed for Automatic Type Acquisition."
,
"javascript.nameSuggestions"
:
"Enable/disable including unique names from the file in JavaScript suggestion lists."
,
"typescript.tsc.autoDetect"
:
"Controls whether auto detection of tsc tasks is on or off."
"typescript.tsc.autoDetect"
:
"Controls whether auto detection of tsc tasks is on or off."
,
"typescript.problemMatchers.tsc.label"
:
"TypeScript problems"
,
"typescript.problemMatchers.tscWatch.label"
:
"TypeScript problems (watch mode)"
}
src/vs/platform/markers/common/problemMatcher.ts
浏览文件 @
4d645781
...
...
@@ -115,10 +115,12 @@ export interface ProblemMatcher {
export
interface
NamedProblemMatcher
extends
ProblemMatcher
{
name
:
string
;
label
:
string
;
}
export
interface
NamedMultiLineProblemPattern
{
name
:
string
;
label
:
string
;
patterns
:
MultiLineProblemPattern
;
}
...
...
@@ -495,6 +497,11 @@ export namespace Config {
* The name of the problem pattern.
*/
name
:
string
;
/**
* A human readable label
*/
label
?:
string
;
}
export
namespace
NamedProblemPattern
{
...
...
@@ -518,6 +525,11 @@ export namespace Config {
*/
name
:
string
;
/**
* A human readable label
*/
label
?:
string
;
/**
* The actual patterns
*/
...
...
@@ -663,6 +675,11 @@ export namespace Config {
* problem matchter from within a task.
*/
name
?:
string
;
/**
* A human reable label.
*/
label
?:
string
;
}
export
function
isNamedProblemMatcher
(
value
:
ProblemMatcher
):
value
is
NamedProblemMatcher
{
...
...
@@ -704,6 +721,7 @@ class ProblemPatternParser extends Parser {
private
createNamedMultiLineProblemPattern
(
value
:
Config
.
NamedMultiLineProblemPattern
):
NamedMultiLineProblemPattern
{
let
result
=
{
name
:
value
.
name
,
label
:
value
.
label
?
value
.
label
:
value
.
name
,
patterns
:
this
.
createMultiLineProblemPattern
(
value
.
patterns
)
};
return
result
.
patterns
?
result
:
null
;
...
...
@@ -1229,7 +1247,8 @@ export class ProblemMatcherParser extends Parser {
}
}
if
(
Config
.
isNamedProblemMatcher
(
description
))
{
(
<
NamedProblemMatcher
>
result
).
name
=
description
.
name
;
(
result
as
NamedProblemMatcher
).
name
=
description
.
name
;
(
result
as
NamedProblemMatcher
).
label
=
Types
.
isString
(
description
.
label
)
?
description
.
label
:
description
.
name
;
}
return
result
;
}
...
...
@@ -1466,9 +1485,13 @@ export namespace Schemas {
export
const
NamedProblemMatcher
:
IJSONSchema
=
Objects
.
clone
(
ProblemMatcher
);
NamedProblemMatcher
.
properties
=
Objects
.
clone
(
NamedProblemMatcher
.
properties
);
NamedProblemMatcher
.
properties
[
'
name
'
]
=
{
NamedProblemMatcher
.
properties
.
name
=
{
type
:
'
string
'
,
description
:
localize
(
'
NamedProblemMatcherSchema.name
'
,
'
The name of the problem matcher.
'
)
description
:
localize
(
'
NamedProblemMatcherSchema.name
'
,
'
The name of the problem matcher used to refer to it.
'
)
};
NamedProblemMatcher
.
properties
.
label
=
{
type
:
'
string
'
,
description
:
localize
(
'
NamedProblemMatcherSchema.label
'
,
'
A human readable label of the problem matcher.
'
)
};
}
...
...
@@ -1481,14 +1504,14 @@ let problemMatchersExtPoint = ExtensionsRegistry.registerExtensionPoint<Config.N
export
interface
IProblemMatcherRegistry
{
onReady
():
TPromise
<
void
>
;
exists
(
name
:
string
):
boolean
;
get
(
name
:
string
):
ProblemMatcher
;
values
():
ProblemMatcher
[];
get
(
name
:
string
):
Named
ProblemMatcher
;
values
():
Named
ProblemMatcher
[];
keys
():
string
[];
}
class
ProblemMatcherRegistryImpl
implements
IProblemMatcherRegistry
{
private
matchers
:
IStringDictionary
<
ProblemMatcher
>
;
private
matchers
:
IStringDictionary
<
Named
ProblemMatcher
>
;
private
readyPromise
:
TPromise
<
void
>
;
constructor
()
{
...
...
@@ -1503,7 +1526,7 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry {
for
(
let
matcher
of
problemMatchers
)
{
let
result
=
parser
.
parse
(
matcher
);
if
(
result
&&
isNamedProblemMatcher
(
result
))
{
this
.
add
(
result
.
name
,
result
);
this
.
add
(
result
);
}
}
});
...
...
@@ -1522,11 +1545,11 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry {
return
this
.
readyPromise
;
}
public
add
(
name
:
string
,
matcher
:
ProblemMatcher
):
void
{
this
.
matchers
[
name
]
=
matcher
;
public
add
(
matcher
:
Named
ProblemMatcher
):
void
{
this
.
matchers
[
matcher
.
name
]
=
matcher
;
}
public
get
(
name
:
string
):
ProblemMatcher
{
public
get
(
name
:
string
):
Named
ProblemMatcher
{
return
this
.
matchers
[
name
];
}
...
...
@@ -1542,19 +1565,23 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry {
return
Object
.
keys
(
this
.
matchers
);
}
public
values
():
ProblemMatcher
[]
{
public
values
():
Named
ProblemMatcher
[]
{
return
Object
.
keys
(
this
.
matchers
).
map
(
key
=>
this
.
matchers
[
key
]);
}
private
fillDefaults
():
void
{
this
.
add
(
'
msCompile
'
,
{
this
.
add
({
name
:
'
msCompile
'
,
label
:
localize
(
'
msCompile
'
,
'
Microsoft compiler problems
'
),
owner
:
'
msCompile
'
,
applyTo
:
ApplyToKind
.
allDocuments
,
fileLocation
:
FileLocationKind
.
Absolute
,
pattern
:
ProblemPatternRegistry
.
get
(
'
msCompile
'
)
});
this
.
add
(
'
lessCompile
'
,
{
this
.
add
({
name
:
'
lessCompile
'
,
label
:
localize
(
'
lessCompile
'
,
'
Less problems
'
),
owner
:
'
lessCompile
'
,
applyTo
:
ApplyToKind
.
allDocuments
,
fileLocation
:
FileLocationKind
.
Absolute
,
...
...
@@ -1562,7 +1589,9 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry {
severity
:
Severity
.
Error
});
this
.
add
(
'
gulp-tsc
'
,
{
this
.
add
({
name
:
'
gulp-tsc
'
,
label
:
localize
(
'
gulp-tsc
'
,
'
Gulp TSC Problems
'
),
owner
:
'
typescript
'
,
applyTo
:
ApplyToKind
.
closedDocuments
,
fileLocation
:
FileLocationKind
.
Relative
,
...
...
@@ -1570,21 +1599,27 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry {
pattern
:
ProblemPatternRegistry
.
get
(
'
gulp-tsc
'
)
});
this
.
add
(
'
jshint
'
,
{
this
.
add
({
name
:
'
jshint
'
,
label
:
localize
(
'
jshint
'
,
'
JSHint problems
'
),
owner
:
'
jshint
'
,
applyTo
:
ApplyToKind
.
allDocuments
,
fileLocation
:
FileLocationKind
.
Absolute
,
pattern
:
ProblemPatternRegistry
.
get
(
'
jshint
'
)
});
this
.
add
(
'
jshint-stylish
'
,
{
this
.
add
({
name
:
'
jshint-stylish
'
,
label
:
localize
(
'
jshint-stylish
'
,
'
JSHint stylish problems
'
),
owner
:
'
jshint
'
,
applyTo
:
ApplyToKind
.
allDocuments
,
fileLocation
:
FileLocationKind
.
Absolute
,
pattern
:
ProblemPatternRegistry
.
get
(
'
jshint-stylish
'
)
});
this
.
add
(
'
eslint-compact
'
,
{
this
.
add
({
name
:
'
eslint-compact
'
,
label
:
localize
(
'
eslint-compact
'
,
'
ESLint compact problems
'
),
owner
:
'
eslint
'
,
applyTo
:
ApplyToKind
.
allDocuments
,
fileLocation
:
FileLocationKind
.
Relative
,
...
...
@@ -1592,14 +1627,18 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry {
pattern
:
ProblemPatternRegistry
.
get
(
'
eslint-compact
'
)
});
this
.
add
(
'
eslint-stylish
'
,
{
this
.
add
({
name
:
'
eslint-stylish
'
,
label
:
localize
(
'
eslint-stylish
'
,
'
ESLint stylish problems
'
),
owner
:
'
eslint
'
,
applyTo
:
ApplyToKind
.
allDocuments
,
fileLocation
:
FileLocationKind
.
Absolute
,
pattern
:
ProblemPatternRegistry
.
get
(
'
eslint-stylish
'
)
});
this
.
add
(
'
go
'
,
{
this
.
add
({
name
:
'
go
'
,
label
:
localize
(
'
go
'
,
'
Go problems
'
),
owner
:
'
go
'
,
applyTo
:
ApplyToKind
.
allDocuments
,
fileLocation
:
FileLocationKind
.
Relative
,
...
...
src/vs/workbench/parts/tasks/browser/buildQuickOpen.ts
浏览文件 @
4d645781
...
...
@@ -6,9 +6,11 @@
import
nls
=
require
(
'
vs/nls
'
);
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
QuickOpen
=
require
(
'
vs/base/parts/quickopen/common/quickOpen
'
);
import
Model
=
require
(
'
vs/base/parts/quickopen/browser/quickOpenModel
'
);
import
{
IQuickOpenService
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
ProblemMatcherRegistry
}
from
'
vs/platform/markers/common/problemMatcher
'
;
import
{
Task
,
TaskGroup
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
ITaskService
}
from
'
vs/workbench/parts/tasks/common/taskService
'
;
...
...
@@ -25,12 +27,14 @@ class TaskEntry extends base.TaskEntry {
return
false
;
}
let
task
=
this
.
_task
;
this
.
taskService
.
run
(
task
);
if
(
task
.
command
.
presentation
.
focus
)
{
this
.
quickOpenService
.
close
();
return
false
;
if
(
task
.
problemMatchers
===
void
0
||
task
.
problemMatchers
.
length
===
0
)
{
this
.
attachProblemMatcher
(
task
).
then
((
task
)
=>
{
this
.
doRun
(
task
);
});
return
true
;
}
else
{
return
this
.
doRun
(
task
);
}
return
true
;
}
}
...
...
@@ -47,7 +51,7 @@ export class QuickOpenHandler extends base.QuickOpenHandler {
}
protected
getTasks
():
TPromise
<
Task
[]
>
{
return
this
.
taskService
.
getTasksForGroup
(
TaskGroup
.
Build
);
return
ProblemMatcherRegistry
.
onReady
().
then
(()
=>
this
.
taskService
.
getTasksForGroup
(
TaskGroup
.
Build
)
);
}
protected
createEntry
(
task
:
Task
,
highlights
:
Model
.
IHighlight
[]):
base
.
TaskEntry
{
...
...
src/vs/workbench/parts/tasks/browser/quickOpen.ts
浏览文件 @
4d645781
...
...
@@ -9,16 +9,22 @@ import Filters = require('vs/base/common/filters');
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IStringDictionary
}
from
'
vs/base/common/collections
'
;
import
*
as
Objects
from
'
vs/base/common/objects
'
;
import
Quickopen
=
require
(
'
vs/workbench/browser/quickopen
'
);
import
QuickOpen
=
require
(
'
vs/base/parts/quickopen/common/quickOpen
'
);
import
Model
=
require
(
'
vs/base/parts/quickopen/browser/quickOpenModel
'
);
import
{
IQuickOpenService
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
IQuickOpenService
,
IPickOpenEntry
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
ProblemMatcherRegistry
,
NamedProblemMatcher
}
from
'
vs/platform/markers/common/problemMatcher
'
;
import
{
Task
,
TaskSourceKind
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
ITaskService
}
from
'
vs/workbench/parts/tasks/common/taskService
'
;
import
{
ActionBarContributor
,
ContributableActionProvider
}
from
'
vs/workbench/browser/actions
'
;
interface
ProblemMatcherPickEntry
extends
IPickOpenEntry
{
matcher
:
NamedProblemMatcher
;
}
export
class
TaskEntry
extends
Model
.
QuickOpenEntry
{
constructor
(
protected
taskService
:
ITaskService
,
protected
quickOpenService
:
IQuickOpenService
,
protected
_task
:
Task
,
highlights
:
Model
.
IHighlight
[]
=
[])
{
...
...
@@ -36,6 +42,44 @@ export class TaskEntry extends Model.QuickOpenEntry {
public
get
task
():
Task
{
return
this
.
_task
;
}
protected
attachProblemMatcher
(
task
:
Task
):
TPromise
<
Task
>
{
let
entries
:
ProblemMatcherPickEntry
[]
=
[];
for
(
let
key
of
ProblemMatcherRegistry
.
keys
())
{
let
matcher
=
ProblemMatcherRegistry
.
get
(
key
);
if
(
matcher
.
name
===
matcher
.
label
)
{
entries
.
push
({
label
:
matcher
.
name
,
matcher
:
matcher
});
}
else
{
entries
.
push
({
label
:
nls
.
localize
(
'
entries
'
,
'
{0} [${1}]
'
,
matcher
.
label
,
matcher
.
name
),
matcher
:
matcher
});
}
}
if
(
entries
.
length
>
0
)
{
entries
.
push
({
label
:
'
Continue without scanning the build output
'
,
separator
:
{
border
:
true
},
matcher
:
undefined
});
return
this
.
quickOpenService
.
pick
(
entries
,
{
placeHolder
:
nls
.
localize
(
'
selectProblemMatcher
'
,
'
Select for which kind of errors and warnings to scan the build output
'
)
}).
then
((
selected
)
=>
{
if
(
selected
&&
selected
.
matcher
)
{
let
newTask
=
Objects
.
deepClone
(
task
);
let
matcherReference
=
`$
${
selected
.
matcher
.
name
}
`
;
newTask
.
problemMatchers
=
[
matcherReference
];
this
.
taskService
.
customize
(
task
,
{
problemMatcher
:
[
matcherReference
]
},
true
);
return
newTask
;
}
else
{
return
task
;
}
});
}
return
TPromise
.
as
(
task
);
}
protected
doRun
(
task
:
Task
):
boolean
{
this
.
taskService
.
run
(
task
);
if
(
task
.
command
.
presentation
.
focus
)
{
this
.
quickOpenService
.
close
();
return
false
;
}
return
true
;
}
}
export
class
TaskGroupEntry
extends
Model
.
QuickOpenEntryGroup
{
...
...
@@ -147,7 +191,7 @@ class CustomizeTaskAction extends Action {
}
public
run
(
context
:
any
):
TPromise
<
any
>
{
return
this
.
taskService
.
customize
(
this
.
task
,
true
).
then
(()
=>
{
return
this
.
taskService
.
customize
(
this
.
task
,
undefined
,
true
).
then
(()
=>
{
this
.
quickOpenService
.
close
();
});
}
...
...
src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts
浏览文件 @
4d645781
...
...
@@ -10,7 +10,7 @@ import QuickOpen = require('vs/base/parts/quickopen/common/quickOpen');
import
Model
=
require
(
'
vs/base/parts/quickopen/browser/quickOpenModel
'
);
import
{
IQuickOpenService
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
Task
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
Task
,
TaskGroup
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
ITaskService
}
from
'
vs/workbench/parts/tasks/common/taskService
'
;
import
{
IExtensionService
}
from
'
vs/platform/extensions/common/extensions
'
;
...
...
@@ -27,12 +27,12 @@ class TaskEntry extends base.TaskEntry {
return
false
;
}
let
task
=
this
.
_task
;
this
.
taskService
.
run
(
task
);
if
(
task
.
command
.
presentation
.
focus
)
{
this
.
quickOpenService
.
close
();
return
false
;
if
(
task
.
group
===
TaskGroup
.
Build
&&
((
task
.
problemMatchers
===
void
0
)
||
task
.
problemMatchers
.
length
===
0
))
{
this
.
attachProblemMatcher
(
task
).
then
(
task
=>
this
.
doRun
(
task
));
return
true
;
}
else
{
return
this
.
doRun
(
task
);
}
return
true
;
}
}
...
...
src/vs/workbench/parts/tasks/common/taskService.ts
浏览文件 @
4d645781
...
...
@@ -45,7 +45,7 @@ export interface ITaskService extends IEventEmitter {
getTasksForGroup
(
group
:
string
):
TPromise
<
Task
[]
>
;
getRecentlyUsedTasks
():
LinkedMap
<
string
,
string
>
;
customize
(
task
:
Task
,
openConfig
?:
boolean
):
TPromise
<
void
>
;
customize
(
task
:
Task
,
properties
?:
{
problemMatcher
:
string
|
string
[]
},
openConfig
?:
boolean
):
TPromise
<
void
>
;
registerTaskProvider
(
handle
:
number
,
taskProvider
:
ITaskProvider
):
void
;
unregisterTaskProvider
(
handle
:
number
):
boolean
;
...
...
src/vs/workbench/parts/tasks/common/tasks.ts
浏览文件 @
4d645781
...
...
@@ -362,6 +362,10 @@ export enum ExecutionEngine {
Terminal
=
2
}
export
namespace
ExecutionEngine
{
export
const
_default
:
ExecutionEngine
=
ExecutionEngine
.
Terminal
;
}
export
enum
JsonSchemaVersion
{
V0_1_0
=
1
,
V2_0_0
=
2
...
...
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
浏览文件 @
4d645781
...
...
@@ -610,7 +610,7 @@ class TaskService extends EventEmitter implements ITaskService {
?
ExecutionEngine
.
Terminal
:
this
.
_taskSystem
instanceof
ProcessTaskSystem
?
ExecutionEngine
.
Process
:
undefined
;
:
ExecutionEngine
.
_default
;
if
(
currentExecutionEngine
!==
this
.
getExecutionEngine
())
{
this
.
messageService
.
show
(
Severity
.
Info
,
nls
.
localize
(
'
TaskSystem.noHotSwap
'
,
'
Changing the task execution engine requires restarting VS Code. The change is ignored.
'
));
}
...
...
@@ -820,7 +820,7 @@ class TaskService extends EventEmitter implements ITaskService {
return
{
configured
,
detected
};
}
public
customize
(
task
:
Task
,
openConfig
:
boolean
=
false
):
TPromise
<
void
>
{
public
customize
(
task
:
Task
,
properties
?:
{
problemMatcher
:
string
|
string
[]
},
openConfig
?:
boolean
):
TPromise
<
void
>
{
if
(
!
ContributedTask
.
is
(
task
))
{
return
TPromise
.
as
<
void
>
(
undefined
);
}
...
...
@@ -836,9 +836,19 @@ class TaskService extends EventEmitter implements ITaskService {
delete
identifier
[
'
_key
'
];
Object
.
keys
(
identifier
).
forEach
(
key
=>
customizes
[
key
]
=
identifier
[
key
]);
if
(
task
.
problemMatchers
===
void
0
||
task
.
problemMatchers
.
length
===
0
)
{
customizes
.
problemMatcher
=
[];
if
(
properties
)
{
for
(
let
property
of
Object
.
getOwnPropertyNames
(
properties
))
{
let
value
=
properties
[
property
];
if
(
value
!==
void
0
&&
value
!==
null
)
{
customizes
[
property
]
=
value
;
}
}
}
else
{
if
(
task
.
problemMatchers
===
void
0
||
task
.
problemMatchers
.
length
===
0
)
{
customizes
.
problemMatcher
=
[];
}
}
if
(
!
fileConfig
)
{
fileConfig
=
{
version
:
'
2.0.0
'
,
...
...
@@ -901,6 +911,8 @@ class TaskService extends EventEmitter implements ITaskService {
return
undefined
;
}
// We can only have extension tasks if we are in version 2.0.0. Then we can even run
// multiple build tasks.
if
(
extensionTasks
.
length
===
1
)
{
return
{
task
:
extensionTasks
[
0
],
resolver
};
}
else
{
...
...
@@ -1152,7 +1164,7 @@ class TaskService extends EventEmitter implements ITaskService {
if
(
hasParseErrors
)
{
return
TPromise
.
as
({
set
:
undefined
,
hasErrors
:
true
,
configurations
:
undefined
});
}
let
engine
=
TaskConfig
.
ExecutionEngine
.
_default
;
let
engine
=
ExecutionEngine
.
_default
;
if
(
config
)
{
engine
=
TaskConfig
.
ExecutionEngine
.
from
(
config
);
if
(
engine
===
ExecutionEngine
.
Process
)
{
...
...
@@ -1229,7 +1241,7 @@ class TaskService extends EventEmitter implements ITaskService {
private
getExecutionEngine
():
ExecutionEngine
{
let
{
config
}
=
this
.
getConfiguration
();
if
(
!
config
)
{
return
ExecutionEngine
.
Terminal
;
return
ExecutionEngine
.
_default
;
}
return
TaskConfig
.
ExecutionEngine
.
from
(
config
);
}
...
...
@@ -1429,9 +1441,8 @@ class TaskService extends EventEmitter implements ITaskService {
return
;
}
this
.
getTasksForGroup
(
TaskGroup
.
Build
).
then
((
tasks
)
=>
{
let
{
configured
,
detected
}
=
this
.
splitTasks
(
tasks
);
let
total
=
configured
.
length
+
detected
.
length
;
if
(
total
===
0
)
{
if
(
tasks
.
length
===
0
)
{
// Show no build task message.
return
;
}
this
.
quickOpenService
.
show
(
'
build task
'
);
...
...
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
浏览文件 @
4d645781
...
...
@@ -1473,8 +1473,6 @@ namespace Globals {
export
namespace
ExecutionEngine
{
export
const
_default
:
Tasks
.
ExecutionEngine
=
Tasks
.
ExecutionEngine
.
Process
;
export
function
from
(
config
:
ExternalTaskRunnerConfiguration
):
Tasks
.
ExecutionEngine
{
let
runner
=
config
.
runner
||
config
.
_runner
;
let
result
:
Tasks
.
ExecutionEngine
;
...
...
@@ -1497,12 +1495,11 @@ export namespace ExecutionEngine {
throw
new
Error
(
'
Shouldn
\'
t happen.
'
);
}
}
}
export
namespace
JsonSchemaVersion
{
export
const
_default
:
Tasks
.
JsonSchemaVersion
=
Tasks
.
JsonSchemaVersion
.
V0_1
_0
;
const
_default
:
Tasks
.
JsonSchemaVersion
=
Tasks
.
JsonSchemaVersion
.
V2_0
_0
;
export
function
from
(
config
:
ExternalTaskRunnerConfiguration
):
Tasks
.
JsonSchemaVersion
{
let
version
=
config
.
version
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录