Открыть боковую панель
code
vscode
Коммиты
861934a3
Не подтверждена
Коммит
861934a3
создал
Авг 17, 2022
по автору
Logan Ramos
Просмотр файлов
Address comments from API sync
владелец
95d21cbc
Изменения
3
Скрыть пробелы
Построчно
Рядом
src/vs/workbench/api/common/extHost.api.impl.ts
Просмотр файла @
861934a3
...
...
@@ -314,16 +314,16 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
return
extHostTelemetry
.
getTelemetryConfiguration
();
},
get
onDidChangeTelemetryEnabled
():
Event
<
boolean
>
{
return
extHostTelemetry
.
onDidChangeTelemetryEnabled
;
if
(
isProposedApiEnabled
(
extension
,
'
telemetry
'
))
{
return
extHostTelemetry
.
onDidChangeTelemetryConfiguration
;
}
else
{
return
extHostTelemetry
.
onDidChangeTelemetryEnabled
;
}
},
get
telemetryConfiguration
():
vscode
.
TelemetryConfiguration
{
checkProposedApiEnabled
(
extension
,
'
telemetry
'
);
return
extHostTelemetry
.
getTelemetryDetails
();
},
get
onDidChangeTelemetryConfiguration
():
Event
<
vscode
.
TelemetryConfiguration
>
{
checkProposedApiEnabled
(
extension
,
'
telemetry
'
);
return
extHostTelemetry
.
onDidChangeTelemetryConfiguration
;
},
get
isNewAppInstall
()
{
const
installAge
=
Date
.
now
()
-
new
Date
(
initData
.
telemetryInfo
.
firstSessionDate
).
getTime
();
return
isNaN
(
installAge
)
?
false
:
installAge
<
1000
*
60
*
60
*
24
;
// install age is less than a day
...
...
src/vs/workbench/api/common/extHostTelemetry.ts
Просмотр файла @
861934a3
...
...
@@ -13,8 +13,9 @@ export class ExtHostTelemetry implements ExtHostTelemetryShape {
private
readonly
_onDidChangeTelemetryEnabled
=
new
Emitter
<
boolean
>
();
readonly
onDidChangeTelemetryEnabled
:
Event
<
boolean
>
=
this
.
_onDidChangeTelemetryEnabled
.
event
;
private
readonly
_onDidChangeTelemetryConfiguration
=
new
Emitter
<
TelemetryConfiguration
>
();
readonly
onDidChangeTelemetryConfiguration
:
Event
<
TelemetryConfiguration
>
=
this
.
_onDidChangeTelemetryConfiguration
.
event
;
// TODO @lramos15 remove this one API is finalized as it's the same as `onDidChangeTelemetryEnabled` just fires more
private
readonly
_onDidChangeTelemetryConfiguration
=
new
Emitter
<
boolean
>
();
readonly
onDidChangeTelemetryConfiguration
:
Event
<
boolean
>
=
this
.
_onDidChangeTelemetryConfiguration
.
event
;
private
_productConfig
:
{
usage
:
boolean
;
error
:
boolean
}
=
{
usage
:
true
,
error
:
true
};
private
_level
:
TelemetryLevel
=
TelemetryLevel
.
NONE
;
...
...
@@ -43,7 +44,7 @@ export class ExtHostTelemetry implements ExtHostTelemetryShape {
if
(
this
.
_oldTelemetryEnablement
!==
this
.
getTelemetryConfiguration
())
{
this
.
_onDidChangeTelemetryEnabled
.
fire
(
this
.
getTelemetryConfiguration
());
}
this
.
_onDidChangeTelemetryConfiguration
.
fire
(
this
.
getTelemetry
Details
());
this
.
_onDidChangeTelemetryConfiguration
.
fire
(
this
.
getTelemetry
Configuration
());
}
}
...
...
src/vscode-dts/vscode.proposed.telemetry.d.ts
Просмотр файла @
861934a3
...
...
@@ -26,11 +26,5 @@ declare module 'vscode' {
* Can be observed to determine what telemetry the extension is allowed to send
*/
export
const
telemetryConfiguration
:
TelemetryConfiguration
;
/**
* An {@link Event} which fires when the collectable state of telemetry changes
* Returns a {@link TelemetryConfiguration} object
*/
export
const
onDidChangeTelemetryConfiguration
:
Event
<
TelemetryConfiguration
|
undefined
>
;
}
}
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать