Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6bba03b8
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,发现更多精彩内容 >>
提交
6bba03b8
编写于
10月 21, 2019
作者:
A
Andrew Liu
提交者:
Alex Ross
10月 21, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix 30419 and 80649 - Allow Setting the Number of Recent Tasks (#82757)
fixes #30419 and fixes #80649
上级
82ca6ba8
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
38 addition
and
10 deletion
+38
-10
src/vs/workbench/contrib/preferences/browser/settingsLayout.ts
...s/workbench/contrib/preferences/browser/settingsLayout.ts
+5
-0
src/vs/workbench/contrib/quickopen/browser/quickopen.contribution.ts
...bench/contrib/quickopen/browser/quickopen.contribution.ts
+1
-1
src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
...vs/workbench/contrib/tasks/browser/abstractTaskService.ts
+26
-8
src/vs/workbench/contrib/tasks/browser/task.contribution.ts
src/vs/workbench/contrib/tasks/browser/task.contribution.ts
+6
-1
未找到文件。
src/vs/workbench/contrib/preferences/browser/settingsLayout.ts
浏览文件 @
6bba03b8
...
...
@@ -155,6 +155,11 @@ export const tocData: ITOCEntry = {
label
:
localize
(
'
terminal
'
,
"
Terminal
"
),
settings
:
[
'
terminal.*
'
]
},
{
id
:
'
features/task
'
,
label
:
localize
(
'
task
'
,
"
Task
"
),
settings
:
[
'
task.*
'
]
},
{
id
:
'
features/problems
'
,
label
:
localize
(
'
problems
'
,
"
Problems
"
),
...
...
src/vs/workbench/contrib/quickopen/browser/quickopen.contribution.ts
浏览文件 @
6bba03b8
src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
浏览文件 @
6bba03b8
...
...
@@ -18,7 +18,7 @@ import * as strings from 'vs/base/common/strings';
import
{
ValidationStatus
,
ValidationState
}
from
'
vs/base/common/parsers
'
;
import
*
as
UUID
from
'
vs/base/common/uuid
'
;
import
*
as
Platform
from
'
vs/base/common/platform
'
;
import
{
L
inkedMap
,
Touch
}
from
'
vs/base/common/map
'
;
import
{
L
RUCache
}
from
'
vs/base/common/map
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
...
...
@@ -80,6 +80,8 @@ import { IPreferencesService } from 'vs/workbench/services/preferences/common/pr
import
{
find
}
from
'
vs/base/common/arrays
'
;
import
{
CancellationToken
,
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
const
QUICKOPEN_HISTORY_LIMIT_CONFIG
=
'
task.quickOpen.history
'
;
export
namespace
ConfigureTaskAction
{
export
const
ID
=
'
workbench.action.tasks.configureTaskRunner
'
;
export
const
TEXT
=
nls
.
localize
(
'
ConfigureTaskRunnerAction.label
'
,
"
Configure Task
"
);
...
...
@@ -209,7 +211,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
protected
_taskSystem
?:
ITaskSystem
;
protected
_taskSystemListener
?:
IDisposable
;
private
_recentlyUsedTasks
:
L
inkedMap
<
string
,
string
>
|
undefined
;
private
_recentlyUsedTasks
:
L
RUCache
<
string
,
string
>
|
undefined
;
protected
_taskRunningState
:
IContextKey
<
boolean
>
;
...
...
@@ -292,6 +294,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
if
(
!
this
.
_taskSystem
||
this
.
_taskSystem
instanceof
TerminalTaskSystem
)
{
this
.
_outputChannel
.
clear
();
}
this
.
setTaskLRUCacheLimit
();
this
.
updateWorkspaceTasks
(
TaskRunSource
.
ConfigurationChange
);
}));
this
.
_taskRunningState
=
TASK_RUNNING_STATE
.
bindTo
(
contextKeyService
);
...
...
@@ -596,11 +600,13 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
return
Promise
.
resolve
(
this
.
_taskSystem
.
getBusyTasks
());
}
public
getRecentlyUsedTasks
():
L
inkedMap
<
string
,
string
>
{
public
getRecentlyUsedTasks
():
L
RUCache
<
string
,
string
>
{
if
(
this
.
_recentlyUsedTasks
)
{
return
this
.
_recentlyUsedTasks
;
}
this
.
_recentlyUsedTasks
=
new
LinkedMap
<
string
,
string
>
();
const
quickOpenHistoryLimit
=
this
.
configurationService
.
getValue
<
number
>
(
QUICKOPEN_HISTORY_LIMIT_CONFIG
);
this
.
_recentlyUsedTasks
=
new
LRUCache
<
string
,
string
>
(
quickOpenHistoryLimit
);
let
storageValue
=
this
.
storageService
.
get
(
AbstractTaskService
.
RecentlyUsedTasks_Key
,
StorageScope
.
WORKSPACE
);
if
(
storageValue
)
{
try
{
...
...
@@ -617,8 +623,15 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
return
this
.
_recentlyUsedTasks
;
}
private
setTaskLRUCacheLimit
()
{
const
quickOpenHistoryLimit
=
this
.
configurationService
.
getValue
<
number
>
(
QUICKOPEN_HISTORY_LIMIT_CONFIG
);
if
(
this
.
_recentlyUsedTasks
)
{
this
.
_recentlyUsedTasks
.
limit
=
quickOpenHistoryLimit
;
}
}
private
setRecentlyUsedTask
(
key
:
string
):
void
{
this
.
getRecentlyUsedTasks
().
set
(
key
,
key
,
Touch
.
AsOld
);
this
.
getRecentlyUsedTasks
().
set
(
key
,
key
);
this
.
saveRecentlyUsedTasks
();
}
...
...
@@ -626,9 +639,14 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
if
(
!
this
.
_taskSystem
||
!
this
.
_recentlyUsedTasks
)
{
return
;
}
const
quickOpenHistoryLimit
=
this
.
configurationService
.
getValue
<
number
>
(
QUICKOPEN_HISTORY_LIMIT_CONFIG
);
// setting history limit to 0 means no LRU sorting
if
(
quickOpenHistoryLimit
===
0
)
{
return
;
}
let
values
=
this
.
_recentlyUsedTasks
.
values
();
if
(
values
.
length
>
30
)
{
values
=
values
.
slice
(
0
,
30
);
if
(
values
.
length
>
quickOpenHistoryLimit
)
{
values
=
values
.
slice
(
0
,
quickOpenHistoryLimit
);
}
this
.
storageService
.
store
(
AbstractTaskService
.
RecentlyUsedTasks_Key
,
JSON
.
stringify
(
values
),
StorageScope
.
WORKSPACE
);
}
...
...
@@ -1907,7 +1925,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
taskMap
[
key
]
=
task
;
}
});
recentlyUsedTasks
.
keys
().
forEach
(
key
=>
{
recentlyUsedTasks
.
keys
().
reverse
().
forEach
(
key
=>
{
let
task
=
taskMap
[
key
];
if
(
task
)
{
recent
.
push
(
task
);
...
...
src/vs/workbench/contrib/tasks/browser/task.contribution.ts
浏览文件 @
6bba03b8
...
...
@@ -352,6 +352,11 @@ configurationRegistry.registerConfiguration({
}
],
default
:
true
}
},
'
task.quickOpen.history
'
:
{
markdownDescription
:
nls
.
localize
(
'
task.quickOpen.history
'
,
"
Controls the number of recent items tracked in task quick open dialog.
"
),
type
:
'
number
'
,
default
:
30
,
minimum
:
0
,
maximum
:
30
},
}
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录