parent
6438e0564a
commit
95d3c1e63b
4 changed files with 10 additions and 10 deletions
6
src/vs/vscode.d.ts
vendored
6
src/vs/vscode.d.ts
vendored
|
@ -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.
|
||||
|
|
5
src/vs/vscode.proposed.d.ts
vendored
5
src/vs/vscode.proposed.d.ts
vendored
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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); }
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue