Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5e2ae873
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
5e2ae873
编写于
4月 30, 2020
作者:
E
Erich Gamma
提交者:
GitHub
4月 30, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Opt in syncing global state (#96662)
Fixes #93332
上级
0476956d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
1 deletion
+20
-1
src/vs/workbench/contrib/surveys/browser/languageSurveys.contribution.ts
...h/contrib/surveys/browser/languageSurveys.contribution.ts
+12
-1
src/vs/workbench/contrib/surveys/browser/nps.contribution.ts
src/vs/workbench/contrib/surveys/browser/nps.contribution.ts
+8
-0
未找到文件。
src/vs/workbench/contrib/surveys/browser/languageSurveys.contribution.ts
浏览文件 @
5e2ae873
...
@@ -10,6 +10,7 @@ import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions as
...
@@ -10,6 +10,7 @@ import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions as
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IStorageKeysSyncRegistryService
}
from
'
vs/platform/userDataSync/common/storageKeys
'
;
import
{
ISurveyData
,
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
ISurveyData
,
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
Severity
,
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
Severity
,
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
...
@@ -25,6 +26,7 @@ class LanguageSurvey extends Disposable {
...
@@ -25,6 +26,7 @@ class LanguageSurvey extends Disposable {
constructor
(
constructor
(
data
:
ISurveyData
,
data
:
ISurveyData
,
storageService
:
IStorageService
,
storageService
:
IStorageService
,
storageKeysSyncRegistryService
:
IStorageKeysSyncRegistryService
,
notificationService
:
INotificationService
,
notificationService
:
INotificationService
,
telemetryService
:
ITelemetryService
,
telemetryService
:
ITelemetryService
,
modelService
:
IModelService
,
modelService
:
IModelService
,
...
@@ -41,6 +43,14 @@ class LanguageSurvey extends Disposable {
...
@@ -41,6 +43,14 @@ class LanguageSurvey extends Disposable {
const
EDITED_LANGUAGE_COUNT_KEY
=
`
${
data
.
surveyId
}
.editedCount`
;
const
EDITED_LANGUAGE_COUNT_KEY
=
`
${
data
.
surveyId
}
.editedCount`
;
const
EDITED_LANGUAGE_DATE_KEY
=
`
${
data
.
surveyId
}
.editedDate`
;
const
EDITED_LANGUAGE_DATE_KEY
=
`
${
data
.
surveyId
}
.editedDate`
;
// opt-in to syncing
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
SESSION_COUNT_KEY
,
version
:
1
});
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
LAST_SESSION_DATE_KEY
,
version
:
1
});
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
SKIP_VERSION_KEY
,
version
:
1
});
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
IS_CANDIDATE_KEY
,
version
:
1
});
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
EDITED_LANGUAGE_COUNT_KEY
,
version
:
1
});
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
EDITED_LANGUAGE_DATE_KEY
,
version
:
1
});
const
skipVersion
=
storageService
.
get
(
SKIP_VERSION_KEY
,
StorageScope
.
GLOBAL
,
''
);
const
skipVersion
=
storageService
.
get
(
SKIP_VERSION_KEY
,
StorageScope
.
GLOBAL
,
''
);
if
(
skipVersion
)
{
if
(
skipVersion
)
{
return
;
return
;
...
@@ -131,6 +141,7 @@ class LanguageSurveysContribution implements IWorkbenchContribution {
...
@@ -131,6 +141,7 @@ class LanguageSurveysContribution implements IWorkbenchContribution {
constructor
(
constructor
(
@
IStorageService
storageService
:
IStorageService
,
@
IStorageService
storageService
:
IStorageService
,
@
IStorageKeysSyncRegistryService
storageKeysSyncRegistryService
:
IStorageKeysSyncRegistryService
,
@
INotificationService
notificationService
:
INotificationService
,
@
INotificationService
notificationService
:
INotificationService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IModelService
modelService
:
IModelService
,
@
IModelService
modelService
:
IModelService
,
...
@@ -144,7 +155,7 @@ class LanguageSurveysContribution implements IWorkbenchContribution {
...
@@ -144,7 +155,7 @@ class LanguageSurveysContribution implements IWorkbenchContribution {
productService
.
surveys
productService
.
surveys
.
filter
(
surveyData
=>
surveyData
.
surveyId
&&
surveyData
.
editCount
&&
surveyData
.
languageId
&&
surveyData
.
surveyUrl
&&
surveyData
.
userProbability
)
.
filter
(
surveyData
=>
surveyData
.
surveyId
&&
surveyData
.
editCount
&&
surveyData
.
languageId
&&
surveyData
.
surveyUrl
&&
surveyData
.
userProbability
)
.
map
(
surveyData
=>
new
LanguageSurvey
(
surveyData
,
storageService
,
notificationService
,
telemetryService
,
modelService
,
textFileService
,
openerService
,
productService
));
.
map
(
surveyData
=>
new
LanguageSurvey
(
surveyData
,
storageService
,
storageKeysSyncRegistryService
,
notificationService
,
telemetryService
,
modelService
,
textFileService
,
openerService
,
productService
));
}
}
}
}
...
...
src/vs/workbench/contrib/surveys/browser/nps.contribution.ts
浏览文件 @
5e2ae873
...
@@ -9,6 +9,7 @@ import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions as
...
@@ -9,6 +9,7 @@ import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions as
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IStorageKeysSyncRegistryService
}
from
'
vs/platform/userDataSync/common/storageKeys
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
Severity
,
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
Severity
,
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
...
@@ -26,6 +27,7 @@ class NPSContribution implements IWorkbenchContribution {
...
@@ -26,6 +27,7 @@ class NPSContribution implements IWorkbenchContribution {
constructor
(
constructor
(
@
IStorageService
storageService
:
IStorageService
,
@
IStorageService
storageService
:
IStorageService
,
@
IStorageKeysSyncRegistryService
storageKeysSyncRegistryService
:
IStorageKeysSyncRegistryService
,
@
INotificationService
notificationService
:
INotificationService
,
@
INotificationService
notificationService
:
INotificationService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IOpenerService
openerService
:
IOpenerService
,
@
IOpenerService
openerService
:
IOpenerService
,
...
@@ -35,6 +37,12 @@ class NPSContribution implements IWorkbenchContribution {
...
@@ -35,6 +37,12 @@ class NPSContribution implements IWorkbenchContribution {
return
;
return
;
}
}
// opt-in to syncing
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
SESSION_COUNT_KEY
,
version
:
1
});
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
LAST_SESSION_DATE_KEY
,
version
:
1
});
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
SKIP_VERSION_KEY
,
version
:
1
});
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
IS_CANDIDATE_KEY
,
version
:
1
});
const
skipVersion
=
storageService
.
get
(
SKIP_VERSION_KEY
,
StorageScope
.
GLOBAL
,
''
);
const
skipVersion
=
storageService
.
get
(
SKIP_VERSION_KEY
,
StorageScope
.
GLOBAL
,
''
);
if
(
skipVersion
)
{
if
(
skipVersion
)
{
return
;
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录