Skip to content

Commit a2b2d31

Browse files
committed
fix user data home on web
1 parent 80b87e2 commit a2b2d31

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/vs/workbench/browser/web.main.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ class CodeRendererMain extends Disposable {
8484
serviceCollection.set(ILogService, logService);
8585

8686
// Environment
87-
const environmentService = new BrowserWorkbenchEnvironmentService(this.configuration);
87+
const remoteUserDataUri = this.getRemoteUserDataUri();
88+
const environmentService = new BrowserWorkbenchEnvironmentService(this.configuration, remoteUserDataUri);
8889
serviceCollection.set(IWorkbenchEnvironmentService, environmentService);
8990

9091
// Product
@@ -115,11 +116,8 @@ class CodeRendererMain extends Disposable {
115116

116117
fileService.registerProvider(Schemas.vscodeRemote, remoteFileSystemProvider);
117118

118-
if (!userDataProvider) {
119-
const remoteUserDataUri = this.getRemoteUserDataUri();
120-
if (remoteUserDataUri) {
121-
userDataProvider = this._register(new FileUserDataProvider(remoteUserDataUri, dirname(remoteUserDataUri), remoteFileSystemProvider));
122-
}
119+
if (!userDataProvider && remoteUserDataUri) {
120+
userDataProvider = this._register(new FileUserDataProvider(remoteUserDataUri, dirname(remoteUserDataUri), remoteFileSystemProvider));
123121
}
124122
}
125123

src/vs/workbench/services/environment/browser/environmentService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ export class BrowserWorkbenchEnvironmentService implements IEnvironmentService {
6363

6464
readonly configuration: IWindowConfiguration = new BrowserWindowConfiguration();
6565

66-
constructor(configuration: IWorkbenchConstructionOptions) {
66+
constructor(configuration: IWorkbenchConstructionOptions, remoteUserDataUri: URI | null) {
6767
this.args = { _: [] };
6868
this.appRoot = '/web/';
6969
this.appNameLong = 'Visual Studio Code - Web';
7070

7171
this.configuration.remoteAuthority = configuration.remoteAuthority;
72-
this.userRoamingDataHome = URI.file('/User').with({ scheme: Schemas.userData });
72+
this.userRoamingDataHome = remoteUserDataUri ? remoteUserDataUri.with({ scheme: Schemas.userData }) : URI.file('/User').with({ scheme: Schemas.userData });
7373
this.settingsResource = joinPath(this.userRoamingDataHome, 'settings.json');
7474
this.keybindingsResource = joinPath(this.userRoamingDataHome, 'keybindings.json');
7575
this.keyboardLayoutResource = joinPath(this.userRoamingDataHome, 'keyboardLayout.json');

0 commit comments

Comments
 (0)