Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ed2bbf3a
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,发现更多精彩内容 >>
提交
ed2bbf3a
编写于
7月 20, 2018
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Task part of #54510
上级
e7058655
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
84 addition
and
73 deletion
+84
-73
src/vs/workbench/browser/parts/menubar/menubar.contribution.ts
...s/workbench/browser/parts/menubar/menubar.contribution.ts
+0
-70
src/vs/workbench/parts/tasks/common/tasks.ts
src/vs/workbench/parts/tasks/common/tasks.ts
+3
-0
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
...rkbench/parts/tasks/electron-browser/task.contribution.ts
+81
-3
未找到文件。
src/vs/workbench/browser/parts/menubar/menubar.contribution.ts
浏览文件 @
ed2bbf3a
...
...
@@ -10,7 +10,6 @@ import { isMacintosh } from 'vs/base/common/platform';
editMenuRegistration
();
selectionMenuRegistration
();
goMenuRegistration
();
tasksMenuRegistration
();
if
(
isMacintosh
)
{
windowMenuRegistration
();
...
...
@@ -447,75 +446,6 @@ function goMenuRegistration() {
});
}
function
tasksMenuRegistration
()
{
// Run Tasks
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
1_run
'
,
command
:
{
id
:
'
workbench.action.tasks.runTask
'
,
title
:
nls
.
localize
({
key
:
'
miRunTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Run Task...
"
)
},
order
:
1
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
1_run
'
,
command
:
{
id
:
'
workbench.action.tasks.build
'
,
title
:
nls
.
localize
({
key
:
'
miBuildTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Run &&Build Task...
"
)
},
order
:
2
});
// Manage Tasks
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
2_manage
'
,
command
:
{
id
:
'
workbench.action.tasks.showTasks
'
,
title
:
nls
.
localize
({
key
:
'
miRunningTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Show Runnin&&g Tasks...
"
)
},
order
:
1
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
2_manage
'
,
command
:
{
id
:
'
workbench.action.tasks.restartTask
'
,
title
:
nls
.
localize
({
key
:
'
miRestartTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
R&&estart Running Task...
"
)
},
order
:
2
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
2_manage
'
,
command
:
{
id
:
'
workbench.action.tasks.terminate
'
,
title
:
nls
.
localize
({
key
:
'
miTerminateTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Terminate Task...
"
)
},
order
:
3
});
// Configure Tasks
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
3_configure
'
,
command
:
{
id
:
'
workbench.action.tasks.configureTaskRunner
'
,
title
:
nls
.
localize
({
key
:
'
miConfigureTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Configure Tasks...
"
)
},
order
:
1
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
3_configure
'
,
command
:
{
id
:
'
workbench.action.tasks.configureDefaultBuildTask
'
,
title
:
nls
.
localize
({
key
:
'
miConfigureBuildTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Configure De&&fault Build Task...
"
)
},
order
:
2
});
}
function
windowMenuRegistration
()
{
}
...
...
src/vs/workbench/parts/tasks/common/tasks.ts
浏览文件 @
ed2bbf3a
...
...
@@ -12,6 +12,9 @@ import { UriComponents } from 'vs/base/common/uri';
import
{
IExtensionDescription
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
ProblemMatcher
}
from
'
vs/workbench/parts/tasks/common/problemMatcher
'
;
import
{
IWorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
export
const
TASK_RUNNING_STATE
=
new
RawContextKey
<
boolean
>
(
'
taskRunning
'
,
false
);
export
enum
ShellQuoting
{
/**
...
...
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
浏览文件 @
ed2bbf3a
...
...
@@ -31,7 +31,7 @@ import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
MenuRegistry
}
from
'
vs/platform/actions/common/actions
'
;
import
{
MenuRegistry
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IMarkerService
,
MarkerStatistics
}
from
'
vs/platform/markers/common/markers
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
...
...
@@ -75,7 +75,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
TaskSorter
,
TaskIdentifier
,
KeyedTaskIdentifier
,
TASK_RUNNING_STATE
}
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
ITaskService
,
ITaskProvider
,
RunOptions
,
CustomizationProperties
,
TaskFilter
}
from
'
vs/workbench/parts/tasks/common/taskService
'
;
import
{
getTemplates
as
getTaskTemplates
}
from
'
vs/workbench/parts/tasks/common/taskTemplates
'
;
...
...
@@ -459,6 +459,8 @@ class TaskService implements ITaskService {
private
_taskSystemListener
:
IDisposable
;
private
_recentlyUsedTasks
:
LinkedMap
<
string
,
string
>
;
private
_taskRunningState
:
IContextKey
<
boolean
>
;
private
_outputChannel
:
IOutputChannel
;
private
readonly
_onDidStateChange
:
Emitter
<
TaskEvent
>
;
...
...
@@ -482,7 +484,9 @@ class TaskService implements ITaskService {
@
IOpenerService
private
openerService
:
IOpenerService
,
@
IWindowService
private
readonly
_windowService
:
IWindowService
,
@
IDialogService
private
dialogService
:
IDialogService
,
@
INotificationService
private
notificationService
:
INotificationService
@
INotificationService
private
notificationService
:
INotificationService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
)
{
this
.
_configHasErrors
=
false
;
this
.
_workspaceTasksPromise
=
undefined
;
...
...
@@ -521,6 +525,7 @@ class TaskService implements ITaskService {
this
.
updateSetup
(
folderSetup
);
this
.
updateWorkspaceTasks
();
});
this
.
_taskRunningState
=
TASK_RUNNING_STATE
.
bindTo
(
contextKeyService
);
lifecycleService
.
onWillShutdown
(
event
=>
event
.
veto
(
this
.
beforeShutdown
()));
this
.
_onDidStateChange
=
new
Emitter
();
this
.
registerCommands
();
...
...
@@ -1292,6 +1297,9 @@ class TaskService implements ITaskService {
this
.
_taskSystem
=
system
;
}
this
.
_taskSystemListener
=
this
.
_taskSystem
.
onDidStateChange
((
event
)
=>
{
if
(
this
.
_taskSystem
)
{
this
.
_taskRunningState
.
set
(
this
.
_taskSystem
.
isActiveSync
());
}
this
.
_onDidStateChange
.
fire
(
event
);
});
return
this
.
_taskSystem
;
...
...
@@ -2420,6 +2428,75 @@ class TaskService implements ITaskService {
}
}
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
1_run
'
,
command
:
{
id
:
'
workbench.action.tasks.runTask
'
,
title
:
nls
.
localize
({
key
:
'
miRunTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Run Task...
"
)
},
order
:
1
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
1_run
'
,
command
:
{
id
:
'
workbench.action.tasks.build
'
,
title
:
nls
.
localize
({
key
:
'
miBuildTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Run &&Build Task...
"
)
},
order
:
2
});
// Manage Tasks
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
2_manage
'
,
command
:
{
precondition
:
TASK_RUNNING_STATE
,
id
:
'
workbench.action.tasks.showTasks
'
,
title
:
nls
.
localize
({
key
:
'
miRunningTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Show Runnin&&g Tasks...
"
)
},
order
:
1
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
2_manage
'
,
command
:
{
precondition
:
TASK_RUNNING_STATE
,
id
:
'
workbench.action.tasks.restartTask
'
,
title
:
nls
.
localize
({
key
:
'
miRestartTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
R&&estart Running Task...
"
)
},
order
:
2
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
2_manage
'
,
command
:
{
precondition
:
TASK_RUNNING_STATE
,
id
:
'
workbench.action.tasks.terminate
'
,
title
:
nls
.
localize
({
key
:
'
miTerminateTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Terminate Task...
"
)
},
order
:
3
});
// Configure Tasks
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
3_configure
'
,
command
:
{
id
:
'
workbench.action.tasks.configureTaskRunner
'
,
title
:
nls
.
localize
({
key
:
'
miConfigureTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Configure Tasks...
"
)
},
order
:
1
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarTasksMenu
,
{
group
:
'
3_configure
'
,
command
:
{
id
:
'
workbench.action.tasks.configureDefaultBuildTask
'
,
title
:
nls
.
localize
({
key
:
'
miConfigureBuildTask
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Configure De&&fault Build Task...
"
)
},
order
:
2
});
MenuRegistry
.
addCommand
({
id
:
ConfigureTaskAction
.
ID
,
title
:
{
value
:
ConfigureTaskAction
.
TEXT
,
original
:
'
Configure Task
'
},
category
:
{
value
:
tasksCategory
,
original
:
'
Tasks
'
}
});
MenuRegistry
.
addCommand
({
id
:
'
workbench.action.tasks.showLog
'
,
title
:
{
value
:
nls
.
localize
(
'
ShowLogAction.label
'
,
"
Show Task Log
"
),
original
:
'
Show Task Log
'
},
category
:
{
value
:
tasksCategory
,
original
:
'
Tasks
'
}
});
MenuRegistry
.
addCommand
({
id
:
'
workbench.action.tasks.runTask
'
,
title
:
{
value
:
nls
.
localize
(
'
RunTaskAction.label
'
,
"
Run Task
"
),
original
:
'
Run Task
'
},
category
:
{
value
:
tasksCategory
,
original
:
'
Tasks
'
}
});
...
...
@@ -2488,6 +2565,7 @@ let schema: IJSONSchema = {
import
schemaVersion1
from
'
./jsonSchema_v1
'
;
import
schemaVersion2
from
'
./jsonSchema_v2
'
;
import
{
TaskDefinitionRegistry
}
from
'
vs/workbench/parts/tasks/common/taskDefinitionRegistry
'
;
import
{
IContextKey
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
schema
.
definitions
=
{
...
schemaVersion1
.
definitions
,
...
schemaVersion2
.
definitions
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录