diff --git a/src/vs/server/webClientServer.ts b/src/vs/server/webClientServer.ts index 00a04d9140926..162a06414688a 100644 --- a/src/vs/server/webClientServer.ts +++ b/src/vs/server/webClientServer.ts @@ -338,7 +338,6 @@ export class WebClientServer { webEndpointUrl: vscodeBase + '/static', webEndpointUrlTemplate: vscodeBase + '/static', webviewContentExternalBaseUrlTemplate: vscodeBase + '/webview/{{uuid}}/', - updateUrl: base + '/update/check' }, folderUri: (workspacePath && isFolder) ? transformer.transformOutgoing(URI.file(workspacePath)) : undefined, @@ -351,6 +350,7 @@ export class WebClientServer { logLevel: this._logService.getLevel(), }, ignoreLastOpened: this._environmentService.ignoreLastOpened, + userDataPath: this._environmentService.userDataPath, settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined, }))) .replace(/{{CLIENT_BACKGROUND_COLOR}}/g, () => backgroundColor) diff --git a/src/vs/workbench/services/environment/browser/environmentService.ts b/src/vs/workbench/services/environment/browser/environmentService.ts index f846e7f726df8..e92df2ca1144e 100644 --- a/src/vs/workbench/services/environment/browser/environmentService.ts +++ b/src/vs/workbench/services/environment/browser/environmentService.ts @@ -116,8 +116,19 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment @memoize get logFile(): URI { return joinPath(this.options.logsPath, 'window.log'); } + /** + * Use the local disk. This solves two problems: + * 1. Extensions running in the browser (like Vim) might use these paths + * directly instead of using the file service and most likely can't write + * to `/User` on disk. + * 2. Settings will be stored in the file system instead of in browser + * storage. Using browser storage makes sharing or seeding settings + * between browsers difficult. We may want to revisit this once/if we get + * settings sync. + * @author coder + */ @memoize - get userRoamingDataHome(): URI { return URI.file('/User').with({ scheme: Schemas.userData }); } + get userRoamingDataHome(): URI { return joinPath(URI.file(this.userDataPath).with({ scheme: Schemas.vscodeRemote }), 'User'); } @memoize get settingsResource(): URI { return joinPath(this.userRoamingDataHome, 'settings.json'); } @@ -256,7 +267,12 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment get ignoreLastOpened(): boolean { return !!this.options.ignoreLastOpened; } - + get userDataPath(): string { + if (!this.options.userDataPath) { + throw new Error('userDataPath was not provided to the browser'); + } + return this.options.userDataPath; + } //#endregion private payload: Map | undefined; diff --git a/src/vs/workbench/workbench.web.api.ts b/src/vs/workbench/workbench.web.api.ts index 1e3014de22cf2..66a05951f1995 100644 --- a/src/vs/workbench/workbench.web.api.ts +++ b/src/vs/workbench/workbench.web.api.ts @@ -345,6 +345,10 @@ interface IWorkbenchConstructionOptions { * @see `BrowserMain#initServices` */ readonly ignoreLastOpened?: boolean + /** + * Path to the user data directory. + */ + readonly userDataPath?: string //#endregion