Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
0bc96575
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,发现更多精彩内容 >>
未验证
提交
0bc96575
编写于
12月 06, 2018
作者:
A
Alex Ross
提交者:
GitHub
12月 06, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't show tasks output on auto task or config change (#64543)
Fixes #64040
上级
95769456
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
16 deletion
+24
-16
src/vs/workbench/parts/tasks/common/taskService.ts
src/vs/workbench/parts/tasks/common/taskService.ts
+2
-2
src/vs/workbench/parts/tasks/common/tasks.ts
src/vs/workbench/parts/tasks/common/tasks.ts
+6
-0
src/vs/workbench/parts/tasks/electron-browser/runAutomaticTasks.ts
...rkbench/parts/tasks/electron-browser/runAutomaticTasks.ts
+2
-2
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
...rkbench/parts/tasks/electron-browser/task.contribution.ts
+14
-12
未找到文件。
src/vs/workbench/parts/tasks/common/taskService.ts
浏览文件 @
0bc96575
...
...
@@ -11,7 +11,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
Task
,
ContributedTask
,
CustomTask
,
TaskSet
,
TaskSorter
,
TaskEvent
,
TaskIdentifier
,
ConfiguringTask
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
Task
,
ContributedTask
,
CustomTask
,
TaskSet
,
TaskSorter
,
TaskEvent
,
TaskIdentifier
,
ConfiguringTask
,
TaskRunSource
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
ITaskSummary
,
TaskTerminateResponse
,
TaskSystemInfo
}
from
'
vs/workbench/parts/tasks/common/taskSystem
'
;
import
{
IStringDictionary
}
from
'
vs/base/common/collections
'
;
...
...
@@ -66,7 +66,7 @@ export interface ITaskService {
terminate
(
task
:
Task
):
TPromise
<
TaskTerminateResponse
>
;
terminateAll
():
TPromise
<
TaskTerminateResponse
[]
>
;
tasks
(
filter
?:
TaskFilter
):
TPromise
<
Task
[]
>
;
getWorkspaceTasks
():
TPromise
<
Map
<
string
,
WorkspaceFolderTaskResult
>>
;
getWorkspaceTasks
(
runSource
?:
TaskRunSource
):
TPromise
<
Map
<
string
,
WorkspaceFolderTaskResult
>>
;
/**
* @param alias The task's name, label or defined identifier.
*/
...
...
src/vs/workbench/parts/tasks/common/tasks.ts
浏览文件 @
0bc96575
...
...
@@ -769,6 +769,12 @@ export interface TaskEvent {
__task
?:
Task
;
}
export
const
enum
TaskRunSource
{
User
,
// Default
FolderOpen
,
ConfigurationChange
}
export
namespace
TaskEvent
{
export
function
create
(
kind
:
TaskEventKind
.
ProcessStarted
,
task
:
Task
,
processId
:
number
):
TaskEvent
;
export
function
create
(
kind
:
TaskEventKind
.
ProcessEnded
,
task
:
Task
,
exitCode
:
number
):
TaskEvent
;
...
...
src/vs/workbench/parts/tasks/electron-browser/runAutomaticTasks.ts
浏览文件 @
0bc96575
...
...
@@ -8,7 +8,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
ITaskService
}
from
'
vs/workbench/parts/tasks/common/taskService
'
;
import
{
forEach
}
from
'
vs/base/common/collections
'
;
import
{
RunOnOptions
,
Task
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
RunOnOptions
,
Task
,
TaskRunSource
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
INotificationService
,
Severity
}
from
'
vs/platform/notification/common/notification
'
;
...
...
@@ -27,7 +27,7 @@ export class RunAutomaticTasks extends Disposable implements IWorkbenchContribut
private
tryRunTasks
(
isAllowed
:
boolean
|
undefined
)
{
// Not necessarily allowed to run the tasks, but we can see if there are any.
if
(
isAllowed
!==
false
)
{
this
.
taskService
.
getWorkspaceTasks
().
then
(
workspaceTaskResult
=>
{
this
.
taskService
.
getWorkspaceTasks
(
TaskRunSource
.
FolderOpen
).
then
(
workspaceTaskResult
=>
{
if
(
workspaceTaskResult
)
{
const
tasks
=
new
Array
<
Task
|
Promise
<
Task
>>
();
workspaceTaskResult
.
forEach
(
resultElement
=>
{
...
...
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
浏览文件 @
0bc96575
...
...
@@ -74,7 +74,7 @@ import { ITaskSystem, ITaskResolver, ITaskSummary, TaskExecuteKind, TaskError, T
import
{
Task
,
CustomTask
,
ConfiguringTask
,
ContributedTask
,
InMemoryTask
,
TaskEvent
,
TaskEventKind
,
TaskSet
,
TaskGroup
,
GroupType
,
ExecutionEngine
,
JsonSchemaVersion
,
TaskSourceKind
,
TaskSorter
,
TaskIdentifier
,
KeyedTaskIdentifier
,
TASK_RUNNING_STATE
TaskSorter
,
TaskIdentifier
,
KeyedTaskIdentifier
,
TASK_RUNNING_STATE
,
TaskRunSource
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
ITaskService
,
ITaskProvider
,
ProblemMatcherRunOptions
,
CustomizationProperties
,
TaskFilter
,
WorkspaceFolderTaskResult
}
from
'
vs/workbench/parts/tasks/common/taskService
'
;
import
{
getTemplates
as
getTaskTemplates
}
from
'
vs/workbench/parts/tasks/common/taskTemplates
'
;
...
...
@@ -526,7 +526,7 @@ class TaskService extends Disposable implements ITaskService {
if
(
!
this
.
_taskSystem
||
this
.
_taskSystem
instanceof
TerminalTaskSystem
)
{
this
.
_outputChannel
.
clear
();
}
this
.
updateWorkspaceTasks
();
this
.
updateWorkspaceTasks
(
TaskRunSource
.
ConfigurationChange
);
}));
this
.
_taskRunningState
=
TASK_RUNNING_STATE
.
bindTo
(
contextKeyService
);
this
.
_register
(
lifecycleService
.
onBeforeShutdown
(
event
=>
event
.
veto
(
this
.
beforeShutdown
())));
...
...
@@ -664,8 +664,10 @@ class TaskService extends Disposable implements ITaskService {
this
.
_schemaVersion
=
setup
[
3
];
}
private
showOutput
():
void
{
this
.
outputService
.
showChannel
(
this
.
_outputChannel
.
id
,
true
);
private
showOutput
(
runSource
:
TaskRunSource
=
TaskRunSource
.
User
):
void
{
if
(
runSource
===
TaskRunSource
.
User
)
{
this
.
outputService
.
showChannel
(
this
.
_outputChannel
.
id
,
true
);
}
}
private
disposeTaskSystemListeners
():
void
{
...
...
@@ -1493,16 +1495,16 @@ class TaskService extends Disposable implements ITaskService {
return
result
;
}
public
getWorkspaceTasks
():
TPromise
<
Map
<
string
,
WorkspaceFolderTaskResult
>>
{
public
getWorkspaceTasks
(
runSource
:
TaskRunSource
=
TaskRunSource
.
User
):
TPromise
<
Map
<
string
,
WorkspaceFolderTaskResult
>>
{
if
(
this
.
_workspaceTasksPromise
)
{
return
this
.
_workspaceTasksPromise
;
}
this
.
updateWorkspaceTasks
();
this
.
updateWorkspaceTasks
(
runSource
);
return
this
.
_workspaceTasksPromise
;
}
private
updateWorkspaceTasks
():
void
{
this
.
_workspaceTasksPromise
=
this
.
computeWorkspaceTasks
().
then
(
value
=>
{
private
updateWorkspaceTasks
(
runSource
:
TaskRunSource
=
TaskRunSource
.
User
):
void
{
this
.
_workspaceTasksPromise
=
this
.
computeWorkspaceTasks
(
runSource
).
then
(
value
=>
{
if
(
this
.
executionEngine
===
ExecutionEngine
.
Process
&&
this
.
_taskSystem
instanceof
ProcessTaskSystem
)
{
// We can only have a process engine if we have one folder.
value
.
forEach
((
value
)
=>
{
...
...
@@ -1514,13 +1516,13 @@ class TaskService extends Disposable implements ITaskService {
});
}
private
computeWorkspaceTasks
():
TPromise
<
Map
<
string
,
WorkspaceFolderTaskResult
>>
{
private
computeWorkspaceTasks
(
runSource
:
TaskRunSource
=
TaskRunSource
.
User
):
TPromise
<
Map
<
string
,
WorkspaceFolderTaskResult
>>
{
if
(
this
.
workspaceFolders
.
length
===
0
)
{
return
TPromise
.
as
(
new
Map
<
string
,
WorkspaceFolderTaskResult
>
());
}
else
{
let
promises
:
TPromise
<
WorkspaceFolderTaskResult
>
[]
=
[];
for
(
let
folder
of
this
.
workspaceFolders
)
{
promises
.
push
(
this
.
computeWorkspaceFolderTasks
(
folder
).
then
((
value
)
=>
value
,
()
=>
undefined
));
promises
.
push
(
this
.
computeWorkspaceFolderTasks
(
folder
,
runSource
).
then
((
value
)
=>
value
,
()
=>
undefined
));
}
return
TPromise
.
join
(
promises
).
then
((
values
)
=>
{
let
result
=
new
Map
<
string
,
WorkspaceFolderTaskResult
>
();
...
...
@@ -1534,7 +1536,7 @@ class TaskService extends Disposable implements ITaskService {
}
}
private
computeWorkspaceFolderTasks
(
workspaceFolder
:
IWorkspaceFolder
):
TPromise
<
WorkspaceFolderTaskResult
>
{
private
computeWorkspaceFolderTasks
(
workspaceFolder
:
IWorkspaceFolder
,
runSource
:
TaskRunSource
=
TaskRunSource
.
User
):
TPromise
<
WorkspaceFolderTaskResult
>
{
return
(
this
.
executionEngine
===
ExecutionEngine
.
Process
?
this
.
computeLegacyConfiguration
(
workspaceFolder
)
:
this
.
computeConfiguration
(
workspaceFolder
)).
...
...
@@ -1549,7 +1551,7 @@ class TaskService extends Disposable implements ITaskService {
let
hasErrors
=
false
;
if
(
!
parseResult
.
validationStatus
.
isOK
())
{
hasErrors
=
true
;
this
.
showOutput
();
this
.
showOutput
(
runSource
);
}
if
(
problemReporter
.
status
.
isFatal
())
{
problemReporter
.
fatal
(
nls
.
localize
(
'
TaskSystem.configurationErrors
'
,
'
Error: the provided task configuration has validation errors and can
\'
t not be used. Please correct the errors first.
'
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录