Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e16c62b3
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,发现更多精彩内容 >>
未验证
提交
e16c62b3
编写于
11月 30, 2018
作者:
A
Alex Ross
提交者:
GitHub
11月 30, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move rerun behavior api out of proposed (#63511)
Fixes #62789
上级
ddd46e86
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
38 addition
and
71 deletion
+38
-71
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+15
-0
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+0
-25
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+0
-1
src/vs/workbench/api/node/extHostTask.ts
src/vs/workbench/api/node/extHostTask.ts
+2
-2
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+1
-6
src/vs/workbench/api/shared/tasks.ts
src/vs/workbench/api/shared/tasks.ts
+1
-2
src/vs/workbench/parts/tasks/common/tasks.ts
src/vs/workbench/parts/tasks/common/tasks.ts
+1
-6
src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts
...s/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts
+4
-4
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
...rkbench/parts/tasks/electron-browser/task.contribution.ts
+2
-2
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
...kbench/parts/tasks/electron-browser/terminalTaskSystem.ts
+8
-4
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
+3
-18
src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts
...h/parts/tasks/test/electron-browser/configuration.test.ts
+1
-1
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
e16c62b3
...
...
@@ -5008,6 +5008,16 @@ declare module 'vscode' {
Workspace
=
2
}
/**
* Run options for a task.
*/
export
interface
RunOptions
{
/**
* Controls whether task variables are re-evaluated on rerun.
*/
reevaluateOnRerun
?:
boolean
;
}
/**
* A task to execute
*/
...
...
@@ -5091,6 +5101,11 @@ declare module 'vscode' {
* array.
*/
problemMatchers
:
string
[];
/**
* Run options for the task
*/
runOptions
:
RunOptions
;
}
/**
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
e16c62b3
...
...
@@ -1178,31 +1178,6 @@ declare module 'vscode' {
}
//#endregion
//#region Task
export
enum
RerunBehavior
{
reevaluate
=
1
,
useEvaluated
=
2
,
}
export
interface
RunOptions
{
/**
* Controls the behavior of a task when it is rerun.
*/
rerunBehavior
?:
RerunBehavior
;
}
/**
* A task to execute
*/
export
class
Task2
extends
Task
{
/**
* Run options for the task. Defaults to an empty literal.
*/
runOptions
:
RunOptions
;
}
//#endregion
//#region Extension Context
export
interface
ExtensionContext
{
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
e16c62b3
...
...
@@ -783,7 +783,6 @@ export function createApiFactory(
QuickInputButtons
:
extHostTypes
.
QuickInputButtons
,
Range
:
extHostTypes
.
Range
,
RelativePattern
:
extHostTypes
.
RelativePattern
,
RerunBehavior
:
extHostTypes
.
RerunBehavior
,
Selection
:
extHostTypes
.
Selection
,
ShellExecution
:
extHostTypes
.
ShellExecution
,
ShellQuoting
:
extHostTypes
.
ShellQuoting
,
...
...
src/vs/workbench/api/node/extHostTask.ts
浏览文件 @
e16c62b3
...
...
@@ -404,7 +404,7 @@ namespace Tasks {
isBackground
:
!!
task
.
isBackground
,
problemMatchers
:
task
.
problemMatchers
.
slice
(),
hasDefinedMatchers
:
(
task
as
types
.
Task
).
hasDefinedMatchers
,
runOptions
:
(
<
vscode
.
Task
2
>
task
).
runOptions
?
(
<
vscode
.
Task2
>
task
).
runOptions
:
{
rerunBehavior
:
tasks
.
RerunBehavior
.
reevaluat
e
},
runOptions
:
(
<
vscode
.
Task
>
task
).
runOptions
?
(
<
vscode
.
Task
>
task
).
runOptions
:
{
reevaluateOnRerun
:
tru
e
},
};
return
result
;
}
...
...
@@ -631,7 +631,7 @@ namespace TaskDTO {
presentationOptions
:
TaskPresentationOptionsDTO
.
from
(
value
.
presentationOptions
),
problemMatchers
:
value
.
problemMatchers
,
hasDefinedMatchers
:
(
value
as
types
.
Task
).
hasDefinedMatchers
,
runOptions
:
(
<
vscode
.
Task
2
>
value
).
runOptions
?
(
<
vscode
.
Task2
>
value
).
runOptions
:
{
rerunBehavior
:
tasks
.
RerunBehavior
.
reevaluat
e
},
runOptions
:
(
<
vscode
.
Task
>
value
).
runOptions
?
(
<
vscode
.
Task
>
value
).
runOptions
:
{
reevaluateOnRerun
:
tru
e
},
};
return
result
;
}
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
e16c62b3
...
...
@@ -1591,12 +1591,7 @@ export enum TaskScope {
Workspace
=
2
}
export
enum
RerunBehavior
{
reevaluate
=
1
,
useEvaluated
=
2
,
}
export
class
Task
implements
vscode
.
Task2
{
export
class
Task
implements
vscode
.
Task
{
private
static
ProcessType
:
string
=
'
process
'
;
private
static
ShellType
:
string
=
'
shell
'
;
...
...
src/vs/workbench/api/shared/tasks.ts
浏览文件 @
e16c62b3
...
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
import
{
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
RerunBehavior
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
export
interface
TaskDefinitionDTO
{
type
:
string
;
...
...
@@ -21,7 +20,7 @@ export interface TaskPresentationOptionsDTO {
}
export
interface
RunOptionsDTO
{
re
runBehavior
?:
RerunBehavior
;
re
evaluateOnRerun
?:
boolean
;
}
export
interface
ExecutionOptionsDTO
{
...
...
src/vs/workbench/parts/tasks/common/tasks.ts
浏览文件 @
e16c62b3
...
...
@@ -421,18 +421,13 @@ export interface ConfigurationProperties {
problemMatchers
?:
(
string
|
ProblemMatcher
)[];
}
export
enum
RerunBehavior
{
reevaluate
=
1
,
useEvaluated
=
2
,
}
export
enum
RunOnOptions
{
default
=
1
,
folderOpen
=
2
}
export
interface
RunOptions
{
re
runBehavior
?:
RerunBehavior
;
re
evaluateOnRerun
?:
boolean
;
runOn
?:
RunOnOptions
;
}
export
interface
CommonTask
{
...
...
src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts
浏览文件 @
e16c62b3
...
...
@@ -284,10 +284,10 @@ const identifier: IJSONSchema = {
const
runOptions
:
IJSONSchema
=
{
type
:
'
object
'
,
properties
:
{
re
runBehavior
:
{
type
:
'
string
'
,
enum
:
[
'
reevauate
'
,
'
useEvaluated
'
]
,
de
scription
:
nls
.
localize
(
'
JsonSchema.tasks.rerunBehavior
'
,
'
The task
\'
s behavior on rerun
'
)
re
evaluateOnRerun
:
{
type
:
'
boolean
'
,
description
:
nls
.
localize
(
'
JsonSchema.tasks.reevaluateOnRerun
'
,
'
Whether to reevaluate task variables on rerun.
'
)
,
de
fault
:
true
},
runOn
:
{
type
:
'
string
'
,
...
...
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
浏览文件 @
e16c62b3
...
...
@@ -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
,
RerunBehavior
TaskSorter
,
TaskIdentifier
,
KeyedTaskIdentifier
,
TASK_RUNNING_STATE
}
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
'
;
...
...
@@ -1172,7 +1172,7 @@ class TaskService extends Disposable implements ITaskService {
name
:
id
,
identifier
:
id
,
dependsOn
:
extensionTasks
.
map
((
task
)
=>
{
return
{
workspaceFolder
:
Task
.
getWorkspaceFolder
(
task
),
task
:
task
.
_id
};
}),
runOptions
:
{
re
runBehavior
:
RerunBehavior
.
reevaluat
e
},
runOptions
:
{
re
evaluateOnRerun
:
tru
e
},
};
return
{
task
,
resolver
};
}
...
...
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
浏览文件 @
e16c62b3
...
...
@@ -32,7 +32,7 @@ import { IOutputService, IOutputChannel } from 'vs/workbench/parts/output/common
import
{
StartStopProblemCollector
,
WatchingProblemCollector
,
ProblemCollectorEventKind
}
from
'
vs/workbench/parts/tasks/common/problemCollectors
'
;
import
{
Task
,
CustomTask
,
ContributedTask
,
RevealKind
,
CommandOptions
,
ShellConfiguration
,
RuntimeType
,
PanelKind
,
TaskEvent
,
TaskEventKind
,
ShellQuotingOptions
,
ShellQuoting
,
CommandString
,
CommandConfiguration
,
RerunBehavior
,
ExtensionTaskSource
,
TaskScope
TaskEvent
,
TaskEventKind
,
ShellQuotingOptions
,
ShellQuoting
,
CommandString
,
CommandConfiguration
,
ExtensionTaskSource
,
TaskScope
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
ITaskSystem
,
ITaskSummary
,
ITaskExecuteResult
,
TaskExecuteKind
,
TaskError
,
TaskErrors
,
ITaskResolver
,
...
...
@@ -201,7 +201,9 @@ export class TerminalTaskSystem implements ITaskSystem {
try
{
const
executeResult
=
{
kind
:
TaskExecuteKind
.
Started
,
task
,
started
:
{},
promise
:
this
.
executeTask
(
task
,
resolver
,
trigger
)
};
this
.
lastTask
=
this
.
currentTask
;
executeResult
.
promise
.
then
(
summary
=>
{
this
.
lastTask
=
this
.
currentTask
;
});
return
executeResult
;
}
catch
(
error
)
{
if
(
error
instanceof
TaskError
)
{
...
...
@@ -218,11 +220,13 @@ export class TerminalTaskSystem implements ITaskSystem {
public
rerun
():
ITaskExecuteResult
|
undefined
{
if
(
this
.
lastTask
&&
this
.
lastTask
.
verify
())
{
if
(
this
.
lastTask
.
task
.
runOptions
.
rerunBehavior
===
RerunBehavior
.
useEvaluated
)
{
if
(
(
this
.
lastTask
.
task
.
runOptions
.
reevaluateOnRerun
!==
void
0
)
&&
!
this
.
lastTask
.
task
.
runOptions
.
reevaluateOnRerun
)
{
this
.
isRerun
=
true
;
}
const
result
=
this
.
run
(
this
.
lastTask
.
task
,
this
.
lastTask
.
resolver
);
this
.
isRerun
=
false
;
result
.
promise
.
then
(
summary
=>
{
this
.
isRerun
=
false
;
});
return
result
;
}
else
{
return
undefined
;
...
...
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
浏览文件 @
e16c62b3
...
...
@@ -120,7 +120,7 @@ export interface PresentationOptionsConfig {
}
export
interface
RunOptionsConfig
{
re
runBehavior
?:
string
;
re
evaluateOnRerun
?:
boolean
;
runOn
?:
string
;
}
...
...
@@ -634,21 +634,6 @@ function _freeze<T>(this: void, target: T, properties: MetaData<T, any>[]): Read
return
target
;
}
export
namespace
RerunBehavior
{
export
function
fromString
(
value
:
string
|
undefined
):
Tasks
.
RerunBehavior
{
if
(
!
value
)
{
return
Tasks
.
RerunBehavior
.
reevaluate
;
}
switch
(
value
.
toLowerCase
())
{
case
'
useevaluated
'
:
return
Tasks
.
RerunBehavior
.
useEvaluated
;
case
'
reevaulate
'
:
default
:
return
Tasks
.
RerunBehavior
.
reevaluate
;
}
}
}
export
namespace
RunOnOptions
{
export
function
fromString
(
value
:
string
|
undefined
):
Tasks
.
RunOnOptions
{
if
(
!
value
)
{
...
...
@@ -667,7 +652,7 @@ export namespace RunOnOptions {
export
namespace
RunOptions
{
export
function
fromConfiguration
(
value
:
RunOptionsConfig
|
undefined
):
Tasks
.
RunOptions
{
return
{
re
runBehavior
:
value
?
RerunBehavior
.
fromString
(
value
.
rerunBehavior
)
:
Tasks
.
RerunBehavior
.
reevaluat
e
,
re
evaluateOnRerun
:
value
?
value
.
reevaluateOnRerun
:
tru
e
,
runOn
:
value
?
RunOnOptions
.
fromString
(
value
.
runOn
)
:
Tasks
.
RunOnOptions
.
default
};
}
...
...
@@ -1904,7 +1889,7 @@ class ConfigurationParser {
isBackground
:
isBackground
,
problemMatchers
:
matchers
,
hasDefinedMatchers
:
false
,
runOptions
:
{
re
runBehavior
:
Tasks
.
RerunBehavior
.
reevaluat
e
},
runOptions
:
{
re
evaluateOnRerun
:
tru
e
},
};
let
value
=
GroupKind
.
from
(
fileConfig
.
group
);
if
(
value
)
{
...
...
src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts
浏览文件 @
e16c62b3
...
...
@@ -193,7 +193,7 @@ class CustomTaskBuilder {
promptOnClose
:
true
,
problemMatchers
:
[],
hasDefinedMatchers
:
false
,
runOptions
:
{
re
runBehavior
:
Tasks
.
RerunBehavior
.
reevaluat
e
},
runOptions
:
{
re
evaluateOnRerun
:
tru
e
},
};
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录