Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
9c681aeb
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
未验证
提交
9c681aeb
编写于
3月 01, 2021
作者:
H
Harald Kirschner
提交者:
Johannes Rieken
3月 29, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Draft for ces survey
上级
74c15f11
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
106 addition
and
0 deletion
+106
-0
src/vs/platform/product/common/productService.ts
src/vs/platform/product/common/productService.ts
+1
-0
src/vs/workbench/contrib/surveys/browser/ces.contribution.ts
src/vs/workbench/contrib/surveys/browser/ces.contribution.ts
+104
-0
src/vs/workbench/workbench.common.main.ts
src/vs/workbench/workbench.common.main.ts
+1
-0
未找到文件。
src/vs/platform/product/common/productService.ts
浏览文件 @
9c681aeb
...
...
@@ -113,6 +113,7 @@ export interface IProductConfiguration {
readonly
telemetryOptOutUrl
?:
string
;
readonly
npsSurveyUrl
?:
string
;
readonly
cesSurveyUrl
?:
string
;
readonly
surveys
?:
readonly
ISurveyData
[];
readonly
checksums
?:
{
[
path
:
string
]:
string
;
};
...
...
src/vs/workbench/contrib/surveys/browser/ces.contribution.ts
0 → 100644
浏览文件 @
9c681aeb
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
nls
from
'
vs/nls
'
;
import
{
language
}
from
'
vs/base/common/platform
'
;
import
{
IWorkbenchContributionsRegistry
,
IWorkbenchContribution
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IStorageService
,
StorageScope
,
StorageTarget
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
LifecyclePhase
}
from
'
vs/workbench/services/lifecycle/common/lifecycle
'
;
import
{
Severity
,
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
platform
}
from
'
vs/base/common/process
'
;
const
PROBABILITY
=
0.15
;
const
SESSION_COUNT_KEY
=
'
ces/sessionCount
'
;
const
LAST_SESSION_DATE_KEY
=
'
ces/lastSessionDate
'
;
const
SKIP_VERSION_KEY
=
'
ces/skipVersion
'
;
const
IS_CANDIDATE_KEY
=
'
ces/isCandidate
'
;
class
CESContribution
implements
IWorkbenchContribution
{
constructor
(
@
IStorageService
storageService
:
IStorageService
,
@
INotificationService
notificationService
:
INotificationService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IOpenerService
openerService
:
IOpenerService
,
@
IProductService
productService
:
IProductService
)
{
// if (!productService.cesSurveyUrl) {
// return;
// }
// const skipVersion = storageService.get(SKIP_VERSION_KEY, StorageScope.GLOBAL, '');
// if (skipVersion) {
// return;
// }
// const date = new Date().toDateString();
// const lastSessionDate = storageService.get(LAST_SESSION_DATE_KEY, StorageScope.GLOBAL, new Date(0).toDateString());
// if (date === lastSessionDate) {
// return;
// }
const
sessionCount
=
(
storageService
.
getNumber
(
SESSION_COUNT_KEY
,
StorageScope
.
GLOBAL
,
0
)
||
0
)
+
1
;
// storageService.store(LAST_SESSION_DATE_KEY, date, StorageScope.GLOBAL, StorageTarget.USER);
// storageService.store(SESSION_COUNT_KEY, sessionCount, StorageScope.GLOBAL, StorageTarget.USER);
// if (sessionCount < 9) {
// return;
// }
// const isCandidate = storageService.getBoolean(IS_CANDIDATE_KEY, StorageScope.GLOBAL, false)
// || Math.random() < PROBABILITY;
// storageService.store(IS_CANDIDATE_KEY, isCandidate, StorageScope.GLOBAL, StorageTarget.USER);
// if (!isCandidate) {
// storageService.store(SKIP_VERSION_KEY, productService.version, StorageScope.GLOBAL, StorageTarget.USER);
// return;
// }
// this.tasExperimentService?.getTreatment<boolean>('newuntitledmode'),
function
rate
(
value
:
string
):
()
=>
void
{
return
function
():
void
{
telemetryService
.
getTelemetryInfo
().
then
(
info
=>
{
openerService
.
open
(
URI
.
parse
(
`
${
productService
.
cesSurveyUrl
}
?o=
${
encodeURIComponent
(
platform
)}
&v=
${
encodeURIComponent
(
productService
.
version
)}
&m=
${
encodeURIComponent
(
info
.
machineId
)}
&v=
${
encodeURIComponent
(
value
)}
`
));
storageService
.
store
(
IS_CANDIDATE_KEY
,
false
,
StorageScope
.
GLOBAL
,
StorageTarget
.
USER
);
storageService
.
store
(
SKIP_VERSION_KEY
,
productService
.
version
,
StorageScope
.
GLOBAL
,
StorageTarget
.
USER
);
});
};
}
notificationService
.
prompt
(
Severity
.
Info
,
nls
.
localize
(
'
surveyQuestion
'
,
"
How easy was it to get started with VS Code?
"
),
[{
label
:
nls
.
localize
(
'
takeSurvey
'
,
"
Take Survey (1min)
"
),
run
:
rate
(
'
0
'
)
},
{
label
:
nls
.
localize
(
'
remindLater
'
,
"
Remind Me later
"
),
run
:
()
=>
storageService
.
store
(
SESSION_COUNT_KEY
,
sessionCount
-
3
,
StorageScope
.
GLOBAL
,
StorageTarget
.
USER
)
},
{
label
:
nls
.
localize
(
'
neverAgain
'
,
"
Don't Show Again
"
),
run
:
()
=>
{
storageService
.
store
(
IS_CANDIDATE_KEY
,
false
,
StorageScope
.
GLOBAL
,
StorageTarget
.
USER
);
storageService
.
store
(
SKIP_VERSION_KEY
,
productService
.
version
,
StorageScope
.
GLOBAL
,
StorageTarget
.
USER
);
}
}],
{
sticky
:
true
}
);
}
}
if
(
language
===
'
en
'
)
{
const
workbenchRegistry
=
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
);
workbenchRegistry
.
registerWorkbenchContribution
(
CESContribution
,
LifecyclePhase
.
Restored
);
}
src/vs/workbench/workbench.common.main.ts
浏览文件 @
9c681aeb
...
...
@@ -274,6 +274,7 @@ import 'vs/workbench/contrib/watermark/browser/watermark';
// Surveys
import
'
vs/workbench/contrib/surveys/browser/nps.contribution
'
;
import
'
vs/workbench/contrib/surveys/browser/ces.contribution
'
;
import
'
vs/workbench/contrib/surveys/browser/languageSurveys.contribution
'
;
// Welcome
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录