Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
92b08e56
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,发现更多精彩内容 >>
提交
92b08e56
编写于
3月 27, 2020
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tasks with same ID but different folders
Fixes #93398
上级
1615443b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
11 deletion
+32
-11
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
+14
-11
src/vs/workbench/contrib/tasks/common/tasks.ts
src/vs/workbench/contrib/tasks/common/tasks.ts
+18
-0
未找到文件。
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
浏览文件 @
92b08e56
...
...
@@ -228,11 +228,12 @@ export class TerminalTaskSystem implements ITaskSystem {
}
public
run
(
task
:
Task
,
resolver
:
ITaskResolver
,
trigger
:
string
=
Triggers
.
command
):
ITaskExecuteResult
{
let
validInstance
=
task
.
runOptions
&&
task
.
runOptions
.
instanceLimit
&&
this
.
instances
[
task
.
_id
]
&&
this
.
instances
[
task
.
_id
].
instances
<
task
.
runOptions
.
instanceLimit
;
let
instance
=
this
.
instances
[
task
.
_id
]
?
this
.
instances
[
task
.
_id
].
instances
:
0
;
const
recentTaskKey
=
task
.
getRecentlyUsedKey
()
??
''
;
let
validInstance
=
task
.
runOptions
&&
task
.
runOptions
.
instanceLimit
&&
this
.
instances
[
recentTaskKey
]
&&
this
.
instances
[
recentTaskKey
].
instances
<
task
.
runOptions
.
instanceLimit
;
let
instance
=
this
.
instances
[
recentTaskKey
]
?
this
.
instances
[
recentTaskKey
].
instances
:
0
;
this
.
currentTask
=
new
VerifiedTask
(
task
,
resolver
,
trigger
);
if
(
instance
>
0
)
{
task
.
instance
=
this
.
instances
[
task
.
_id
].
counter
;
task
.
instance
=
this
.
instances
[
recentTaskKey
].
counter
;
}
let
lastTaskInstance
=
this
.
getLastInstance
(
task
);
let
terminalData
=
lastTaskInstance
?
this
.
activeTasks
[
lastTaskInstance
.
getMapKey
()]
:
undefined
;
...
...
@@ -247,10 +248,10 @@ export class TerminalTaskSystem implements ITaskSystem {
this
.
lastTask
=
this
.
currentTask
;
});
if
(
InMemoryTask
.
is
(
task
)
||
!
this
.
isTaskEmpty
(
task
))
{
if
(
!
this
.
instances
[
task
.
_id
])
{
this
.
instances
[
task
.
_id
]
=
new
InstanceManager
();
if
(
!
this
.
instances
[
recentTaskKey
])
{
this
.
instances
[
recentTaskKey
]
=
new
InstanceManager
();
}
this
.
instances
[
task
.
_id
].
addInstance
();
this
.
instances
[
recentTaskKey
].
addInstance
();
}
return
executeResult
;
}
catch
(
error
)
{
...
...
@@ -339,8 +340,9 @@ export class TerminalTaskSystem implements ITaskSystem {
public
getLastInstance
(
task
:
Task
):
Task
|
undefined
{
let
lastInstance
=
undefined
;
const
recentKey
=
task
.
getRecentlyUsedKey
();
Object
.
keys
(
this
.
activeTasks
).
forEach
((
key
)
=>
{
if
(
task
.
_id
===
this
.
activeTasks
[
key
].
task
.
_id
)
{
if
(
recentKey
&&
recentKey
===
this
.
activeTasks
[
key
].
task
.
getRecentlyUsedKey
()
)
{
lastInstance
=
this
.
activeTasks
[
key
].
task
;
}
});
...
...
@@ -364,10 +366,11 @@ export class TerminalTaskSystem implements ITaskSystem {
}
private
removeInstances
(
task
:
Task
)
{
if
(
this
.
instances
[
task
.
_id
])
{
this
.
instances
[
task
.
_id
].
removeInstance
();
if
(
this
.
instances
[
task
.
_id
].
instances
===
0
)
{
delete
this
.
instances
[
task
.
_id
];
const
recentTaskKey
=
task
.
getRecentlyUsedKey
()
??
''
;
if
(
this
.
instances
[
recentTaskKey
])
{
this
.
instances
[
recentTaskKey
].
removeInstance
();
if
(
this
.
instances
[
recentTaskKey
].
instances
===
0
)
{
delete
this
.
instances
[
recentTaskKey
];
}
}
}
...
...
src/vs/workbench/contrib/tasks/common/tasks.ts
浏览文件 @
92b08e56
...
...
@@ -802,6 +802,24 @@ export class ConfiguringTask extends CommonTask {
public
getWorkspaceFolder
():
IWorkspaceFolder
|
undefined
{
return
this
.
_source
.
config
.
workspaceFolder
;
}
public
getRecentlyUsedKey
():
string
|
undefined
{
interface
CustomKey
{
type
:
string
;
folder
:
string
;
id
:
string
;
}
let
workspaceFolder
=
this
.
_source
.
kind
===
TaskSourceKind
.
User
?
USER_TASKS_GROUP_KEY
:
this
.
_source
.
config
.
workspaceFolder
?.
uri
.
toString
();
if
(
!
workspaceFolder
)
{
return
undefined
;
}
let
id
:
string
=
this
.
configurationProperties
.
identifier
!
;
if
(
this
.
_source
.
kind
!==
TaskSourceKind
.
Workspace
)
{
id
+=
this
.
_source
.
kind
;
}
let
key
:
CustomKey
=
{
type
:
CUSTOMIZED_TASK_TYPE
,
folder
:
workspaceFolder
,
id
};
return
JSON
.
stringify
(
key
);
}
}
export
class
ContributedTask
extends
CommonTask
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录