diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index b8db1d68f61..76a355c018c 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -7906,6 +7906,12 @@ declare module 'vscode' { */ export const sessionId: string; + /** + * Indicates that this is a fresh install of the application. + * `true` if within the first day of installation otherwise `false`. + */ + export const isNewAppInstall: boolean; + /** * The name of a remote. Defined by extensions, popular samples are `wsl` for the Windows * Subsystem for Linux or `ssh-remote` for remotes using a secure shell. diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 061f398d9f2..14785c206be 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -2103,11 +2103,6 @@ declare module 'vscode' { export interface ExtensionContext { readonly extensionRuntime: ExtensionRuntime; - - /** - * Indicates that this is a fresh install of VS Code. - */ - readonly isNewInstall: boolean; } //#endregion diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 3f1a6431f99..6f953976ef5 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -303,6 +303,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I checkProposedApiEnabled(extension); return extHostTelemetry.onDidChangeTelemetryEnabled; }, + 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 + }, openExternal(uri: URI, options?: { allowContributedOpeners?: boolean | string; }) { return extHostWindow.openUri(uri, { allowTunneling: !!initData.remote.authority, diff --git a/src/vs/workbench/api/common/extHostExtensionService.ts b/src/vs/workbench/api/common/extHostExtensionService.ts index 56fb1c262be..47641e7993c 100644 --- a/src/vs/workbench/api/common/extHostExtensionService.ts +++ b/src/vs/workbench/api/common/extHostExtensionService.ts @@ -388,7 +388,6 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme const extensionMode = extensionDescription.isUnderDevelopment ? (this._initData.environment.extensionTestsLocationURI ? ExtensionMode.Test : ExtensionMode.Development) : ExtensionMode.Production; - const installAge = Date.now() - new Date(this._initData.telemetryInfo.firstSessionDate).getTime(); this._logService.trace(`ExtensionService#loadExtensionContext ${extensionDescription.identifier.value}`); @@ -425,10 +424,6 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme checkProposedApiEnabled(extensionDescription); return that.extensionRuntime; }, - get isNewInstall() { - checkProposedApiEnabled(extensionDescription); - return isNaN(installAge) ? false : installAge < 1000 * 60 * 60 * 24; // installAge is less than a day; - }, get environmentVariableCollection() { return that._extHostTerminalService.getEnvironmentVariableCollection(extensionDescription); } }); });