Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b03cf79c
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,发现更多精彩内容 >>
提交
b03cf79c
编写于
9月 27, 2020
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
上级
ce74b1a8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
12 deletion
+11
-12
src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.ts
...ons/browser/extensionRecommendationNotificationService.ts
+11
-12
未找到文件。
src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.ts
浏览文件 @
b03cf79c
...
...
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
distinct
}
from
'
vs/base/common/arrays
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
ConfigurationTarget
,
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
@@ -38,7 +39,7 @@ type ExtensionWorkspaceRecommendationsNotificationClassification = {
userReaction
:
{
classification
:
'
SystemMetaData
'
,
purpose
:
'
FeatureInsight
'
};
};
const
ignoreImportantExtensionRecommendation
=
'
extensionsAssistant/importantRecommendationsIgnore
'
;
const
ignoreImportantExtensionRecommendation
StorageKey
=
'
extensionsAssistant/importantRecommendationsIgnore
'
;
const
ignoreWorkspaceRecommendationsStorageKey
=
'
extensionsAssistant/workspaceRecommendationsIgnore
'
;
const
choiceNever
=
localize
(
'
neverShowAgain
'
,
"
Don't Show Again
"
);
...
...
@@ -50,7 +51,7 @@ export class ExtensionRecommendationNotificationService implements IExtensionRec
// Ignored Important Recommendations
get
ignoredRecommendations
():
string
[]
{
return
[...(
<
string
[]
>
JSON
.
parse
(
this
.
storageService
.
get
(
ignoreImportantExtensionRecommendation
,
StorageScope
.
GLOBAL
,
'
[]
'
)))].
map
(
i
=>
i
.
toLowerCase
(
));
return
distinct
([...(
<
string
[]
>
JSON
.
parse
(
this
.
storageService
.
get
(
ignoreImportantExtensionRecommendationStorageKey
,
StorageScope
.
GLOBAL
,
'
[]
'
)))].
map
(
i
=>
i
.
toLowerCase
()
));
}
constructor
(
...
...
@@ -66,7 +67,7 @@ export class ExtensionRecommendationNotificationService implements IExtensionRec
@
IStorageKeysSyncRegistryService
storageKeysSyncRegistryService
:
IStorageKeysSyncRegistryService
,
@
optional
(
ITASExperimentService
)
tasExperimentService
:
ITASExperimentService
,
)
{
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
ignoreImportantExtensionRecommendation
,
version
:
1
});
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
ignoreImportantExtensionRecommendation
StorageKey
,
version
:
1
});
this
.
tasExperimentService
=
tasExperimentService
;
}
...
...
@@ -80,7 +81,8 @@ export class ExtensionRecommendationNotificationService implements IExtensionRec
return
false
;
}
extensionIds
=
this
.
filterIgnoredOrNotAllowed
(
extensionIds
);
const
ignoredRecommendations
=
[...
this
.
extensionIgnoredRecommendationsService
.
ignoredRecommendations
,
...
this
.
ignoredRecommendations
];
extensionIds
=
extensionIds
.
filter
(
id
=>
!
ignoredRecommendations
.
includes
(
id
));
if
(
!
extensionIds
.
length
)
{
return
false
;
}
...
...
@@ -221,11 +223,6 @@ export class ExtensionRecommendationNotificationService implements IExtensionRec
return
extensions
;
}
private
filterIgnoredOrNotAllowed
(
recommendationsToSuggest
:
string
[]):
string
[]
{
const
ignoredRecommendations
=
[...
this
.
extensionIgnoredRecommendationsService
.
ignoredRecommendations
,
...
this
.
ignoredRecommendations
];
return
recommendationsToSuggest
.
filter
(
id
=>
!
ignoredRecommendations
.
includes
(
id
));
}
private
async
runAction
(
action
:
IAction
):
Promise
<
void
>
{
try
{
await
action
.
run
();
...
...
@@ -235,9 +232,11 @@ export class ExtensionRecommendationNotificationService implements IExtensionRec
}
private
addToImportantRecommendationsIgnore
(
id
:
string
)
{
const
importantRecommendationsIgnoreList
=
<
string
[]
>
JSON
.
parse
(
this
.
storageService
.
get
(
ignoreImportantExtensionRecommendation
,
StorageScope
.
GLOBAL
,
'
[]
'
));
importantRecommendationsIgnoreList
.
push
(
id
.
toLowerCase
());
this
.
storageService
.
store
(
ignoreImportantExtensionRecommendation
,
JSON
.
stringify
(
importantRecommendationsIgnoreList
),
StorageScope
.
GLOBAL
);
const
importantRecommendationsIgnoreList
=
[...
this
.
ignoredRecommendations
];
if
(
!
importantRecommendationsIgnoreList
.
includes
(
id
.
toLowerCase
()))
{
importantRecommendationsIgnoreList
.
push
(
id
.
toLowerCase
());
this
.
storageService
.
store
(
ignoreImportantExtensionRecommendationStorageKey
,
JSON
.
stringify
(
importantRecommendationsIgnoreList
),
StorageScope
.
GLOBAL
);
}
}
private
setIgnoreRecommendationsConfig
(
configVal
:
boolean
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录