Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
3b798fd8
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3b798fd8
编写于
6月 21, 2018
作者:
R
Ramya Achutha Rao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove avoidable dependency of tipsservice in extworkbenchservice
上级
fce9e3de
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
27 deletion
+25
-27
src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts
...parts/extensions/electron-browser/extensionTipsService.ts
+24
-2
src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts
...bench/parts/extensions/node/extensionsWorkbenchService.ts
+1
-25
未找到文件。
src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts
浏览文件 @
3b798fd8
...
...
@@ -10,7 +10,10 @@ import { forEach } from 'vs/base/common/collections';
import
{
IDisposable
,
dispose
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
match
}
from
'
vs/base/common/glob
'
;
import
*
as
json
from
'
vs/base/common/json
'
;
import
{
IExtensionManagementService
,
IExtensionGalleryService
,
IExtensionTipsService
,
ExtensionRecommendationReason
,
LocalExtensionType
,
EXTENSION_IDENTIFIER_PATTERN
,
IIgnoredRecommendations
,
IExtensionsConfigContent
,
RecommendationChangeNotification
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
IExtensionManagementService
,
IExtensionGalleryService
,
IExtensionTipsService
,
ExtensionRecommendationReason
,
LocalExtensionType
,
EXTENSION_IDENTIFIER_PATTERN
,
IIgnoredRecommendations
,
IExtensionsConfigContent
,
RecommendationChangeNotification
,
InstallOperation
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
ITextModel
}
from
'
vs/editor/common/model
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
...
...
@@ -37,6 +40,7 @@ import { isNumber } from 'vs/base/common/types';
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
const
empty
:
{
[
key
:
string
]:
any
;
}
=
Object
.
create
(
null
);
const
milliSecondsInADay
=
1000
*
60
*
60
*
24
;
...
...
@@ -92,7 +96,8 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
@
IExtensionService
private
extensionService
:
IExtensionService
,
@
IRequestService
private
requestService
:
IRequestService
,
@
IViewletService
private
viewletService
:
IViewletService
,
@
INotificationService
private
notificationService
:
INotificationService
@
INotificationService
private
notificationService
:
INotificationService
,
@
IExtensionManagementService
private
extensionManagementService
:
IExtensionManagementService
)
{
super
();
...
...
@@ -128,6 +133,23 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
this
.
fetchProactiveRecommendations
();
}
}));
this
.
_register
(
this
.
extensionManagementService
.
onDidInstallExtension
(
e
=>
{
if
(
e
.
gallery
&&
e
.
operation
===
InstallOperation
.
Install
)
{
const
extRecommendations
=
this
.
getAllRecommendationsWithReason
()
||
{};
const
recommendationReason
=
extRecommendations
[
e
.
gallery
.
identifier
.
id
.
toLowerCase
()];
if
(
recommendationReason
)
{
/* __GDPR__
"extensionGallery:install:recommendations" : {
"recommendationReason": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
"${include}": [
"${GalleryExtensionTelemetryData}"
]
}
*/
this
.
telemetryService
.
publicLog
(
'
extensionGallery:install:recommendations
'
,
assign
(
e
.
gallery
.
telemetryData
,
{
recommendationReason
:
recommendationReason
.
reasonId
}));
}
}
}));
}
private
fetchProactiveRecommendations
(
calledDuringStartup
?:
boolean
):
TPromise
<
void
>
{
...
...
src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts
浏览文件 @
3b798fd8
...
...
@@ -10,7 +10,6 @@ import { readFile } from 'vs/base/node/pfs';
import
*
as
semver
from
'
semver
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
index
}
from
'
vs/base/common/arrays
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
ThrottledDelayer
}
from
'
vs/base/common/async
'
;
import
{
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
...
...
@@ -19,7 +18,7 @@ import { IPager, mapPager, singlePagePager } from 'vs/base/common/paging';
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IExtensionManagementService
,
IExtensionGalleryService
,
ILocalExtension
,
IGalleryExtension
,
IQueryOptions
,
IExtensionManifest
,
InstallExtensionEvent
,
DidInstallExtensionEvent
,
LocalExtensionType
,
DidUninstallExtensionEvent
,
IExtensionEnablementService
,
IExtensionIdentifier
,
EnablementState
,
IExtensionTipsService
,
InstallOperation
InstallExtensionEvent
,
DidInstallExtensionEvent
,
LocalExtensionType
,
DidUninstallExtensionEvent
,
IExtensionEnablementService
,
IExtensionIdentifier
,
EnablementState
,
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
getGalleryExtensionIdFromLocal
,
getGalleryExtensionTelemetryData
,
getLocalExtensionTelemetryData
,
areSameExtensions
,
getMaliciousExtensionsSet
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -358,7 +357,6 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
@
IWindowService
private
windowService
:
IWindowService
,
@
ILogService
private
logService
:
ILogService
,
@
IProgressService2
private
progressService
:
IProgressService2
,
@
IExtensionTipsService
private
extensionTipsService
:
IExtensionTipsService
,
@
IExtensionService
private
runtimeExtensionService
:
IExtensionService
)
{
this
.
stateProvider
=
ext
=>
this
.
getExtensionState
(
ext
);
...
...
@@ -860,10 +858,6 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
this
.
installed
.
push
(
extension
);
}
}
if
(
extension
.
gallery
&&
event
.
operation
===
InstallOperation
.
Install
)
{
// Report recommendation telemetry only for gallery extensions that are first time installs
this
.
reportExtensionRecommendationsTelemetry
(
installingExtension
);
}
}
this
.
_onChange
.
fire
();
}
...
...
@@ -922,24 +916,6 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
return
local
?
ExtensionState
.
Installed
:
ExtensionState
.
Uninstalled
;
}
private
reportExtensionRecommendationsTelemetry
(
extension
:
Extension
):
void
{
const
extRecommendations
=
this
.
extensionTipsService
.
getAllRecommendationsWithReason
()
||
{};
const
recommendationReason
=
extRecommendations
[
extension
.
id
.
toLowerCase
()];
if
(
recommendationReason
)
{
const
recommendationsData
=
{
recommendationReason
:
recommendationReason
.
reasonId
};
const
data
=
extension
.
telemetryData
;
/* __GDPR__
"extensionGallery:install:recommendations" : {
"recommendationReason": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
"${include}": [
"${GalleryExtensionTelemetryData}"
]
}
*/
this
.
telemetryService
.
publicLog
(
'
extensionGallery:install:recommendations
'
,
assign
(
data
,
recommendationsData
));
}
}
private
onError
(
err
:
any
):
void
{
if
(
isPromiseCanceledError
(
err
))
{
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录