Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
634e8ea9
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,发现更多精彩内容 >>
提交
634e8ea9
编写于
8月 15, 2019
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Simplify tasks command
上级
bca9d853
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
27 deletion
+16
-27
src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts
src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts
+14
-24
src/vs/workbench/contrib/tasks/browser/task.contribution.ts
src/vs/workbench/contrib/tasks/browser/task.contribution.ts
+2
-3
未找到文件。
src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts
浏览文件 @
634e8ea9
...
...
@@ -12,6 +12,7 @@ import { RunOnOptions, Task, TaskRunSource } from 'vs/workbench/contrib/tasks/co
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
INotificationService
,
Severity
}
from
'
vs/platform/notification/common/notification
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
IQuickPickItem
,
IQuickInputService
}
from
'
vs/platform/quickinput/common/quickInput
'
;
const
ARE_AUTOMATIC_TASKS_ALLOWED_IN_WORKSPACE
=
'
tasks.run.allowAutomatic
'
;
...
...
@@ -131,38 +132,27 @@ export class RunAutomaticTasks extends Disposable implements IWorkbenchContribut
}
export
class
Allow
AutomaticTaskRunning
extends
Action
{
export
class
Manage
AutomaticTaskRunning
extends
Action
{
public
static
readonly
ID
=
'
workbench.action.tasks.
allow
AutomaticRunning
'
;
public
static
readonly
LABEL
=
nls
.
localize
(
'
workbench.action.tasks.
allowAutomaticRunning
'
,
"
Allow
Automatic Tasks in Folder
"
);
public
static
readonly
ID
=
'
workbench.action.tasks.
manage
AutomaticRunning
'
;
public
static
readonly
LABEL
=
nls
.
localize
(
'
workbench.action.tasks.
manageAutomaticRunning
'
,
"
Manage
Automatic Tasks in Folder
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IStorageService
private
readonly
storageService
:
IStorageService
@
IStorageService
private
readonly
storageService
:
IStorageService
,
@
IQuickInputService
private
readonly
quickInputService
:
IQuickInputService
)
{
super
(
id
,
label
);
}
public
run
(
event
?:
any
):
Promise
<
any
>
{
this
.
storageService
.
store
(
ARE_AUTOMATIC_TASKS_ALLOWED_IN_WORKSPACE
,
true
,
StorageScope
.
WORKSPACE
);
return
Promise
.
resolve
(
undefined
);
}
}
export
class
DisallowAutomaticTaskRunning
extends
Action
{
public
static
readonly
ID
=
'
workbench.action.tasks.disallowAutomaticRunning
'
;
public
static
readonly
LABEL
=
nls
.
localize
(
'
workbench.action.tasks.disallowAutomaticRunning
'
,
"
Disallow Automatic Tasks in Folder
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IStorageService
private
readonly
storageService
:
IStorageService
)
{
super
(
id
,
label
);
}
public
async
run
(
event
?:
any
):
Promise
<
any
>
{
const
allowItem
:
IQuickPickItem
=
{
label
:
nls
.
localize
(
'
workbench.action.tasks.allowAutomaticTasks
'
,
"
Allow Automatic Tasks in Folder
"
)
};
const
disallowItem
:
IQuickPickItem
=
{
label
:
nls
.
localize
(
'
workbench.action.tasks.disallowAutomaticTasks
'
,
"
Disallow Automatic Tasks in Folder
"
)
};
const
value
=
await
this
.
quickInputService
.
pick
([
allowItem
,
disallowItem
],
{
canPickMany
:
false
});
if
(
!
value
)
{
return
;
}
public
run
(
event
?:
any
):
Promise
<
any
>
{
this
.
storageService
.
store
(
ARE_AUTOMATIC_TASKS_ALLOWED_IN_WORKSPACE
,
false
,
StorageScope
.
WORKSPACE
);
return
Promise
.
resolve
(
undefined
);
this
.
storageService
.
store
(
ARE_AUTOMATIC_TASKS_ALLOWED_IN_WORKSPACE
,
value
===
allowItem
,
StorageScope
.
WORKSPACE
);
}
}
src/vs/workbench/contrib/tasks/browser/task.contribution.ts
浏览文件 @
634e8ea9
...
...
@@ -32,7 +32,7 @@ import { QuickOpenActionContributor } from '../browser/quickOpen';
import
{
Extensions
as
WorkbenchExtensions
,
IWorkbenchContributionsRegistry
,
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
IWorkbenchActionRegistry
,
Extensions
as
ActionExtensions
}
from
'
vs/workbench/common/actions
'
;
import
{
RunAutomaticTasks
,
AllowAutomaticTaskRunning
,
Disallow
AutomaticTaskRunning
}
from
'
vs/workbench/contrib/tasks/browser/runAutomaticTasks
'
;
import
{
RunAutomaticTasks
,
Manage
AutomaticTaskRunning
}
from
'
vs/workbench/contrib/tasks/browser/runAutomaticTasks
'
;
let
tasksCategory
=
nls
.
localize
(
'
tasksCategory
'
,
"
Tasks
"
);
...
...
@@ -40,8 +40,7 @@ const workbenchRegistry = Registry.as<IWorkbenchContributionsRegistry>(Workbench
workbenchRegistry
.
registerWorkbenchContribution
(
RunAutomaticTasks
,
LifecyclePhase
.
Eventually
);
const
actionRegistry
=
Registry
.
as
<
IWorkbenchActionRegistry
>
(
ActionExtensions
.
WorkbenchActions
);
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
AllowAutomaticTaskRunning
,
AllowAutomaticTaskRunning
.
ID
,
AllowAutomaticTaskRunning
.
LABEL
),
'
Tasks: Allow Automatic Tasks in Folder
'
,
tasksCategory
);
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
DisallowAutomaticTaskRunning
,
DisallowAutomaticTaskRunning
.
ID
,
DisallowAutomaticTaskRunning
.
LABEL
),
'
Tasks: Disallow Automatic Tasks in Folder
'
,
tasksCategory
);
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
ManageAutomaticTaskRunning
,
ManageAutomaticTaskRunning
.
ID
,
ManageAutomaticTaskRunning
.
LABEL
),
'
Tasks: Manage Automatic Tasks in Folder
'
,
tasksCategory
);
export
class
TaskStatusBarContributions
extends
Disposable
implements
IWorkbenchContribution
{
private
runningTasksStatusItem
:
IStatusbarEntryAccessor
|
undefined
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录