提交 2e85ce75 编写于 作者: B Benjamin Pasero

web - wire in userDataPath properly

上级 dc4a864a
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
keybindingsPath: '{{KEYBINDINGS}}', keybindingsPath: '{{KEYBINDINGS}}',
folderPath: '{{FOLDER}}', folderPath: '{{FOLDER}}',
workspacePath: '{{WORKSPACE}}', workspacePath: '{{WORKSPACE}}',
userDataPath: '{{USER_DATA}}'
} }
</script> </script>
......
...@@ -33,8 +33,10 @@ import { WebResources } from 'vs/workbench/browser/web.resources'; ...@@ -33,8 +33,10 @@ import { WebResources } from 'vs/workbench/browser/web.resources';
import { ISignService } from 'vs/platform/sign/common/sign'; import { ISignService } from 'vs/platform/sign/common/sign';
import { SignService } from 'vs/platform/sign/browser/signService'; import { SignService } from 'vs/platform/sign/browser/signService';
import { hash } from 'vs/base/common/hash'; import { hash } from 'vs/base/common/hash';
import { joinPath } from 'vs/base/common/resources';
interface IWindowConfiguration { interface IWindowConfiguration {
userDataUri: URI;
settingsUri: URI; settingsUri: URI;
keybindingsUri: URI; keybindingsUri: URI;
remoteAuthority: string; remoteAuthority: string;
...@@ -140,7 +142,7 @@ class CodeRendererMain extends Disposable { ...@@ -140,7 +142,7 @@ class CodeRendererMain extends Disposable {
const environmentService = new SimpleWorkbenchEnvironmentService(); const environmentService = new SimpleWorkbenchEnvironmentService();
environmentService.appRoot = '/web/'; environmentService.appRoot = '/web/';
environmentService.args = { _: [] }; environmentService.args = { _: [] };
environmentService.appSettingsHome = toResource('/web/settings'); environmentService.appSettingsHome = joinPath(this.configuration.userDataUri, 'User');
environmentService.settingsResource = this.configuration.settingsUri; environmentService.settingsResource = this.configuration.settingsUri;
environmentService.keybindingsResource = this.configuration.keybindingsUri; environmentService.keybindingsResource = this.configuration.keybindingsUri;
environmentService.logsPath = '/web/logs'; environmentService.logsPath = '/web/logs';
...@@ -148,11 +150,11 @@ class CodeRendererMain extends Disposable { ...@@ -148,11 +150,11 @@ class CodeRendererMain extends Disposable {
port: null, port: null,
break: false break: false
}; };
return environmentService; return environmentService;
} }
private async createWorkspaceService(payload: IWorkspaceInitializationPayload, fileService: FileService, remoteAgentService: IRemoteAgentService, logService: ILogService): Promise<WorkspaceService> { private async createWorkspaceService(payload: IWorkspaceInitializationPayload, fileService: FileService, remoteAgentService: IRemoteAgentService, logService: ILogService): Promise<WorkspaceService> {
const workspaceService = new WorkspaceService({ userSettingsResource: this.configuration.settingsUri, remoteAuthority: this.configuration.remoteAuthority, configurationCache: new ConfigurationCache() }, new ConfigurationFileService(fileService), remoteAgentService); const workspaceService = new WorkspaceService({ userSettingsResource: this.configuration.settingsUri, remoteAuthority: this.configuration.remoteAuthority, configurationCache: new ConfigurationCache() }, new ConfigurationFileService(fileService), remoteAgentService);
try { try {
...@@ -184,6 +186,7 @@ class CodeRendererMain extends Disposable { ...@@ -184,6 +186,7 @@ class CodeRendererMain extends Disposable {
} }
export interface IWindowConfigurationContents { export interface IWindowConfigurationContents {
userDataPath: string;
settingsPath: string; settingsPath: string;
keybindingsPath: string; keybindingsPath: string;
folderPath?: string; folderPath?: string;
...@@ -192,12 +195,14 @@ export interface IWindowConfigurationContents { ...@@ -192,12 +195,14 @@ export interface IWindowConfigurationContents {
export function main(windowConfigurationContents: IWindowConfigurationContents): Promise<void> { export function main(windowConfigurationContents: IWindowConfigurationContents): Promise<void> {
const windowConfiguration: IWindowConfiguration = { const windowConfiguration: IWindowConfiguration = {
userDataUri: toResource(windowConfigurationContents.userDataPath),
settingsUri: toResource(windowConfigurationContents.settingsPath), settingsUri: toResource(windowConfigurationContents.settingsPath),
keybindingsUri: toResource(windowConfigurationContents.keybindingsPath), keybindingsUri: toResource(windowConfigurationContents.keybindingsPath),
folderUri: windowConfigurationContents.folderPath ? toResource(windowConfigurationContents.folderPath) : undefined, folderUri: windowConfigurationContents.folderPath ? toResource(windowConfigurationContents.folderPath) : undefined,
workspaceUri: windowConfigurationContents.workspacePath ? toResource(windowConfigurationContents.workspacePath) : undefined, workspaceUri: windowConfigurationContents.workspacePath ? toResource(windowConfigurationContents.workspacePath) : undefined,
remoteAuthority: document.location.host remoteAuthority: document.location.host
}; };
const renderer = new CodeRendererMain(windowConfiguration); const renderer = new CodeRendererMain(windowConfiguration);
return renderer.open(); return renderer.open();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册