Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
127e136d
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,发现更多精彩内容 >>
提交
127e136d
编写于
2月 14, 2017
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dbaeumer/10676'
上级
59657986
4ad4d908
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
233 addition
and
236 deletion
+233
-236
src/vs/workbench/parts/tasks/common/taskConfiguration.ts
src/vs/workbench/parts/tasks/common/taskConfiguration.ts
+58
-2
src/vs/workbench/parts/tasks/common/taskSystem.ts
src/vs/workbench/parts/tasks/common/taskSystem.ts
+22
-0
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
...rkbench/parts/tasks/electron-browser/task.contribution.ts
+137
-214
src/vs/workbench/parts/tasks/node/processRunnerDetector.ts
src/vs/workbench/parts/tasks/node/processRunnerDetector.ts
+13
-13
src/vs/workbench/parts/tasks/node/processRunnerSystem.ts
src/vs/workbench/parts/tasks/node/processRunnerSystem.ts
+2
-6
src/vs/workbench/parts/tasks/test/node/configuration.test.ts
src/vs/workbench/parts/tasks/test/node/configuration.test.ts
+1
-1
未找到文件。
src/vs/workbench/parts/tasks/
node/processRunner
Configuration.ts
→
src/vs/workbench/parts/tasks/
common/task
Configuration.ts
浏览文件 @
127e136d
...
...
@@ -14,8 +14,12 @@ import * as UUID from 'vs/base/common/uuid';
import
{
Config
as
ProcessConfig
}
from
'
vs/base/common/processes
'
;
import
{
ValidationStatus
,
ValidationState
,
ILogger
}
from
'
vs/base/common/parsers
'
;
import
{
NamedProblemMatcher
,
ProblemMatcher
,
ProblemMatcherParser
,
Config
as
ProblemMatcherConfig
,
registry
as
ProblemMatcherRegistry
,
isNamedProblemMatcher
}
from
'
vs/platform/markers/common/problemMatcher
'
;
import
*
as
TaskSystem
from
'
vs/workbench/parts/tasks/common/taskSystem
'
;
import
{
NamedProblemMatcher
,
ProblemMatcher
,
ProblemMatcherParser
,
Config
as
ProblemMatcherConfig
,
registry
as
ProblemMatcherRegistry
,
isNamedProblemMatcher
}
from
'
vs/platform/markers/common/problemMatcher
'
;
import
*
as
TaskSystem
from
'
./taskSystem
'
;
/**
* Defines the problem handling strategy
...
...
@@ -55,6 +59,24 @@ export interface PlatformTaskDescription {
args
?:
string
[];
}
export
interface
CommandBinding
{
/**
* The command identifer the task is bound to.
*/
identifier
?:
string
;
/**
* The title to use
*/
title
?:
string
;
/**
* An optional category
*/
category
?:
string
;
}
/**
* The description of a task.
*/
...
...
@@ -122,6 +144,11 @@ export interface TaskDescription extends PlatformTaskDescription {
*/
suppressTaskName
?:
boolean
;
/**
* The command this task is bound to.
*/
bindTo
?:
CommandBinding
;
/**
* The problem matcher(s) to use to capture problems in the tasks
* output.
...
...
@@ -623,6 +650,32 @@ namespace ProblemMatcherConverter {
}
}
namespace
CommandBinding
{
export
function
isEmpty
(
value
:
TaskSystem
.
CommandBinding
):
boolean
{
return
!
value
||
value
.
identifier
===
void
0
&&
value
.
title
===
void
0
&&
value
.
category
===
void
0
;
}
export
function
from
(
this
:
void
,
binding
:
CommandBinding
,
context
:
ParseContext
):
TaskSystem
.
CommandBinding
{
if
(
!
binding
)
{
return
undefined
;
}
if
(
!
Types
.
isString
(
binding
.
identifier
))
{
context
.
validationStatus
.
state
=
ValidationState
.
Warning
;
context
.
logger
.
log
(
nls
.
localize
(
'
noCommandId
'
,
'
Warning: a command binding must defined an identifier. Ignoring binding.
'
));
return
undefined
;
}
let
result
:
TaskSystem
.
CommandBinding
=
{
identifier
:
binding
.
identifier
,
title
:
''
};
if
(
Types
.
isString
(
binding
.
category
))
{
result
.
category
=
binding
.
category
;
}
return
result
;
}
}
namespace
TaskDescription
{
export
interface
TaskConfiguration
{
...
...
@@ -682,6 +735,9 @@ namespace TaskDescription {
task
.
suppressTaskName
=
!!
externalTask
.
suppressTaskName
;
}
if
(
externalTask
.
bindTo
)
{
task
.
bindTo
=
CommandBinding
.
from
(
externalTask
.
bindTo
,
context
);
}
if
(
problemMatchers
)
{
task
.
problemMatchers
=
problemMatchers
;
}
...
...
src/vs/workbench/parts/tasks/common/taskSystem.ts
浏览文件 @
127e136d
...
...
@@ -136,6 +136,23 @@ export interface CommandConfiguration {
echo
?:
boolean
;
}
export
interface
CommandBinding
{
/**
* The command identifier the task is bound to.
*/
identifier
:
string
;
/**
* The title to use
*/
title
:
string
;
/**
* An optional category
*/
category
?:
string
;
}
/**
* A task description
*/
...
...
@@ -183,6 +200,11 @@ export interface TaskDescription {
*/
showOutput
:
ShowOutput
;
/**
* The command this task is bound to.
*/
bindTo
?:
CommandBinding
;
/**
* The problem watchers to use for this task
*/
...
...
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
浏览文件 @
127e136d
此差异已折叠。
点击以展开。
src/vs/workbench/parts/tasks/node/processRunnerDetector.ts
浏览文件 @
127e136d
...
...
@@ -20,7 +20,7 @@ import { IConfigurationResolverService } from 'vs/workbench/services/configurati
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
*
as
FileConfig
from
'
./processRunner
Configuration
'
;
import
*
as
TaskConfig
from
'
../common/task
Configuration
'
;
let
build
:
string
=
'
build
'
;
let
test
:
string
=
'
test
'
;
...
...
@@ -109,7 +109,7 @@ class GruntTaskMatcher implements TaskDetectorMatcher {
}
export
interface
DetectorResult
{
config
:
File
Config
.
ExternalTaskRunnerConfiguration
;
config
:
Task
Config
.
ExternalTaskRunnerConfiguration
;
stdout
:
string
[];
stderr
:
string
[];
}
...
...
@@ -143,12 +143,12 @@ export class ProcessRunnerDetector {
private
fileService
:
IFileService
;
private
contextService
:
IWorkspaceContextService
;
private
configurationResolverService
:
IConfigurationResolverService
;
private
taskConfiguration
:
File
Config
.
ExternalTaskRunnerConfiguration
;
private
taskConfiguration
:
Task
Config
.
ExternalTaskRunnerConfiguration
;
private
_stderr
:
string
[];
private
_stdout
:
string
[];
private
_cwd
:
string
;
constructor
(
fileService
:
IFileService
,
contextService
:
IWorkspaceContextService
,
configurationResolverService
:
IConfigurationResolverService
,
config
:
File
Config
.
ExternalTaskRunnerConfiguration
=
null
)
{
constructor
(
fileService
:
IFileService
,
contextService
:
IWorkspaceContextService
,
configurationResolverService
:
IConfigurationResolverService
,
config
:
Task
Config
.
ExternalTaskRunnerConfiguration
=
null
)
{
this
.
fileService
=
fileService
;
this
.
contextService
=
contextService
;
this
.
configurationResolverService
=
configurationResolverService
;
...
...
@@ -225,27 +225,27 @@ export class ProcessRunnerDetector {
return
result
;
}
private
tryDetectGulp
(
list
:
boolean
):
TPromise
<
{
config
:
File
Config
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
private
tryDetectGulp
(
list
:
boolean
):
TPromise
<
{
config
:
Task
Config
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
return
this
.
fileService
.
resolveFile
(
this
.
contextService
.
toResource
(
'
gulpfile.js
'
)).
then
((
stat
)
=>
{
let
config
=
ProcessRunnerDetector
.
detectorConfig
(
'
gulp
'
);
let
process
=
new
LineProcess
(
'
gulp
'
,
[
config
.
arg
,
'
--no-color
'
],
true
,
{
cwd
:
this
.
_cwd
});
return
this
.
runDetection
(
process
,
'
gulp
'
,
true
,
config
.
matcher
,
ProcessRunnerDetector
.
DefaultProblemMatchers
,
list
);
},
(
err
:
any
):
File
Config
.
ExternalTaskRunnerConfiguration
=>
{
},
(
err
:
any
):
Task
Config
.
ExternalTaskRunnerConfiguration
=>
{
return
null
;
});
}
private
tryDetectGrunt
(
list
:
boolean
):
TPromise
<
{
config
:
File
Config
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
private
tryDetectGrunt
(
list
:
boolean
):
TPromise
<
{
config
:
Task
Config
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
return
this
.
fileService
.
resolveFile
(
this
.
contextService
.
toResource
(
'
Gruntfile.js
'
)).
then
((
stat
)
=>
{
let
config
=
ProcessRunnerDetector
.
detectorConfig
(
'
grunt
'
);
let
process
=
new
LineProcess
(
'
grunt
'
,
[
config
.
arg
,
'
--no-color
'
],
true
,
{
cwd
:
this
.
_cwd
});
return
this
.
runDetection
(
process
,
'
grunt
'
,
true
,
config
.
matcher
,
ProcessRunnerDetector
.
DefaultProblemMatchers
,
list
);
},
(
err
:
any
):
File
Config
.
ExternalTaskRunnerConfiguration
=>
{
},
(
err
:
any
):
Task
Config
.
ExternalTaskRunnerConfiguration
=>
{
return
null
;
});
}
private
tryDetectJake
(
list
:
boolean
):
TPromise
<
{
config
:
File
Config
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
private
tryDetectJake
(
list
:
boolean
):
TPromise
<
{
config
:
Task
Config
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
let
run
=
()
=>
{
let
config
=
ProcessRunnerDetector
.
detectorConfig
(
'
jake
'
);
let
process
=
new
LineProcess
(
'
jake
'
,
[
config
.
arg
],
true
,
{
cwd
:
this
.
_cwd
});
...
...
@@ -256,7 +256,7 @@ export class ProcessRunnerDetector {
},
(
err
:
any
)
=>
{
return
this
.
fileService
.
resolveFile
(
this
.
contextService
.
toResource
(
'
Jakefile.js
'
)).
then
((
stat
)
=>
{
return
run
();
},
(
err
:
any
):
File
Config
.
ExternalTaskRunnerConfiguration
=>
{
},
(
err
:
any
):
Task
Config
.
ExternalTaskRunnerConfiguration
=>
{
return
null
;
});
});
...
...
@@ -276,7 +276,7 @@ export class ProcessRunnerDetector {
}
return
{
config
:
null
,
stdout
:
this
.
_stdout
,
stderr
:
this
.
_stderr
};
}
let
result
:
File
Config
.
ExternalTaskRunnerConfiguration
=
{
let
result
:
Task
Config
.
ExternalTaskRunnerConfiguration
=
{
version
:
ProcessRunnerDetector
.
Version
,
command
:
command
,
isShellCommand
:
isShellCommand
...
...
@@ -314,8 +314,8 @@ export class ProcessRunnerDetector {
});
}
private
createTaskDescriptions
(
tasks
:
string
[],
problemMatchers
:
string
[],
list
:
boolean
):
File
Config
.
TaskDescription
[]
{
let
taskConfigs
:
File
Config
.
TaskDescription
[]
=
[];
private
createTaskDescriptions
(
tasks
:
string
[],
problemMatchers
:
string
[],
list
:
boolean
):
Task
Config
.
TaskDescription
[]
{
let
taskConfigs
:
Task
Config
.
TaskDescription
[]
=
[];
if
(
list
)
{
tasks
.
forEach
((
task
)
=>
{
taskConfigs
.
push
({
...
...
src/vs/workbench/parts/tasks/node/processRunnerSystem.ts
浏览文件 @
127e136d
...
...
@@ -53,7 +53,7 @@ export class ProcessRunnerSystem extends EventEmitter implements ITaskSystem {
private
activeTaskPromise
:
TPromise
<
ITaskSummary
>
;
constructor
(
configuration
:
TaskRunnerConfiguration
,
markerService
:
IMarkerService
,
modelService
:
IModelService
,
telemetryService
:
ITelemetryService
,
outputService
:
IOutputService
,
configurationResolverService
:
IConfigurationResolverService
,
outputChannelId
:
string
,
clearOutput
:
boolean
=
true
)
{
outputService
:
IOutputService
,
configurationResolverService
:
IConfigurationResolverService
,
outputChannelId
:
string
,
hasErrors
:
boolean
)
{
super
();
this
.
configuration
=
configuration
;
this
.
markerService
=
markerService
;
...
...
@@ -66,11 +66,7 @@ export class ProcessRunnerSystem extends EventEmitter implements ITaskSystem {
this
.
activeTaskIdentifier
=
null
;
this
.
activeTaskPromise
=
null
;
this
.
outputChannel
=
this
.
outputService
.
getChannel
(
outputChannelId
);
if
(
clearOutput
)
{
this
.
clearOutput
();
}
this
.
errorsShown
=
false
;
this
.
errorsShown
=
!
hasErrors
;
}
...
...
src/vs/workbench/parts/tasks/test/node/configuration.test.ts
浏览文件 @
127e136d
...
...
@@ -12,7 +12,7 @@ import * as Platform from 'vs/base/common/platform';
import
{
ProblemMatcher
,
FileLocationKind
,
ProblemPattern
,
ApplyToKind
}
from
'
vs/platform/markers/common/problemMatcher
'
;
import
*
as
TaskSystem
from
'
vs/workbench/parts/tasks/common/taskSystem
'
;
import
{
parse
,
ParseResult
,
ILogger
,
ExternalTaskRunnerConfiguration
}
from
'
vs/workbench/parts/tasks/
node/processRunner
Configuration
'
;
import
{
parse
,
ParseResult
,
ILogger
,
ExternalTaskRunnerConfiguration
}
from
'
vs/workbench/parts/tasks/
common/task
Configuration
'
;
class
Logger
implements
ILogger
{
public
receivedMessage
:
boolean
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录