From 2dc2290ba9a43817da3d79bcc419fdfb952bc01f Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 9 Mar 2022 10:15:49 +0100 Subject: [PATCH] history - introduce a `localHistoryHome` environment --- src/vs/platform/environment/common/environment.ts | 1 + src/vs/platform/environment/common/environmentService.ts | 7 +++++-- src/vs/platform/remote/common/remoteAgentEnvironment.ts | 1 + src/vs/server/node/remoteAgentEnvironmentImpl.ts | 1 + .../services/environment/browser/environmentService.ts | 7 +++++-- .../remote/common/remoteAgentEnvironmentChannel.ts | 2 ++ 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/vs/platform/environment/common/environment.ts b/src/vs/platform/environment/common/environment.ts index 22d030e30f4..28a690c69bb 100644 --- a/src/vs/platform/environment/common/environment.ts +++ b/src/vs/platform/environment/common/environment.ts @@ -59,6 +59,7 @@ export interface IEnvironmentService { untitledWorkspacesHome: URI; globalStorageHome: URI; workspaceStorageHome: URI; + localHistoryHome: URI; cacheHome: URI; // --- settings sync diff --git a/src/vs/platform/environment/common/environmentService.ts b/src/vs/platform/environment/common/environmentService.ts index 82dc3799130..ac02eadcbdb 100644 --- a/src/vs/platform/environment/common/environmentService.ts +++ b/src/vs/platform/environment/common/environmentService.ts @@ -87,10 +87,13 @@ export abstract class AbstractNativeEnvironmentService implements INativeEnviron get machineSettingsResource(): URI { return joinPath(URI.file(join(this.userDataPath, 'Machine')), 'settings.json'); } @memoize - get globalStorageHome(): URI { return URI.joinPath(this.appSettingsHome, 'globalStorage'); } + get globalStorageHome(): URI { return joinPath(this.appSettingsHome, 'globalStorage'); } @memoize - get workspaceStorageHome(): URI { return URI.joinPath(this.appSettingsHome, 'workspaceStorage'); } + get workspaceStorageHome(): URI { return joinPath(this.appSettingsHome, 'workspaceStorage'); } + + @memoize + get localHistoryHome(): URI { return joinPath(this.appSettingsHome, 'History'); } @memoize get keybindingsResource(): URI { return joinPath(this.userRoamingDataHome, 'keybindings.json'); } diff --git a/src/vs/platform/remote/common/remoteAgentEnvironment.ts b/src/vs/platform/remote/common/remoteAgentEnvironment.ts index 3feda96194f..c1d3bfb2357 100644 --- a/src/vs/platform/remote/common/remoteAgentEnvironment.ts +++ b/src/vs/platform/remote/common/remoteAgentEnvironment.ts @@ -17,6 +17,7 @@ export interface IRemoteAgentEnvironment { extensionHostLogsPath: URI; globalStorageHome: URI; workspaceStorageHome: URI; + localHistoryHome: URI; userHome: URI; os: OperatingSystem; arch: string; diff --git a/src/vs/server/node/remoteAgentEnvironmentImpl.ts b/src/vs/server/node/remoteAgentEnvironmentImpl.ts index 9333c996382..36a11016d2f 100644 --- a/src/vs/server/node/remoteAgentEnvironmentImpl.ts +++ b/src/vs/server/node/remoteAgentEnvironmentImpl.ts @@ -325,6 +325,7 @@ export class RemoteAgentEnvironmentChannel implements IServerChannel { extensionHostLogsPath: URI.file(join(this.environmentService.logsPath, `exthost${RemoteAgentEnvironmentChannel._namePool++}`)), globalStorageHome: this.environmentService.globalStorageHome, workspaceStorageHome: this.environmentService.workspaceStorageHome, + localHistoryHome: this.environmentService.localHistoryHome, userHome: this.environmentService.userHome, os: platform.OS, arch: process.arch, diff --git a/src/vs/workbench/services/environment/browser/environmentService.ts b/src/vs/workbench/services/environment/browser/environmentService.ts index 838100ee020..33929757dd7 100644 --- a/src/vs/workbench/services/environment/browser/environmentService.ts +++ b/src/vs/workbench/services/environment/browser/environmentService.ts @@ -67,10 +67,13 @@ export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvi get cacheHome(): URI { return joinPath(this.userRoamingDataHome, 'caches'); } @memoize - get globalStorageHome(): URI { return URI.joinPath(this.userRoamingDataHome, 'globalStorage'); } + get globalStorageHome(): URI { return joinPath(this.userRoamingDataHome, 'globalStorage'); } @memoize - get workspaceStorageHome(): URI { return URI.joinPath(this.userRoamingDataHome, 'workspaceStorage'); } + get workspaceStorageHome(): URI { return joinPath(this.userRoamingDataHome, 'workspaceStorage'); } + + @memoize + get localHistoryHome(): URI { return joinPath(this.userRoamingDataHome, 'History'); } /** * In Web every workspace can potentially have scoped user-data diff --git a/src/vs/workbench/services/remote/common/remoteAgentEnvironmentChannel.ts b/src/vs/workbench/services/remote/common/remoteAgentEnvironmentChannel.ts index c274c717974..ba9cba3ccf8 100644 --- a/src/vs/workbench/services/remote/common/remoteAgentEnvironmentChannel.ts +++ b/src/vs/workbench/services/remote/common/remoteAgentEnvironmentChannel.ts @@ -40,6 +40,7 @@ export interface IRemoteAgentEnvironmentDTO { extensionHostLogsPath: UriComponents; globalStorageHome: UriComponents; workspaceStorageHome: UriComponents; + localHistoryHome: UriComponents; userHome: UriComponents; os: platform.OperatingSystem; arch: string; @@ -66,6 +67,7 @@ export class RemoteExtensionEnvironmentChannelClient { extensionHostLogsPath: URI.revive(data.extensionHostLogsPath), globalStorageHome: URI.revive(data.globalStorageHome), workspaceStorageHome: URI.revive(data.workspaceStorageHome), + localHistoryHome: URI.revive(data.localHistoryHome), userHome: URI.revive(data.userHome), os: data.os, arch: data.arch,