Derive configuration resources

This commit is contained in:
Sandeep Somavarapu
2019-06-13 09:55:35 +02:00
parent 07ea8c2ced
commit ff38c0fee5
2 changed files with 5 additions and 11 deletions
@@ -15,8 +15,6 @@
self.CONNECTION_AUTH_TOKEN = '{{CONNECTION_AUTH_TOKEN}}';
self.SERVER_APP_ROOT = '{{SERVER_APP_ROOT}}';
self.WINDOW_CONFIGURATION = {
settingsPath: '{{SETTINGS}}',
keybindingsPath: '{{KEYBINDINGS}}',
folderPath: '{{FOLDER}}',
workspacePath: '{{WORKSPACE}}',
userDataPath: '{{USER_DATA}}'
+5 -9
View File
@@ -37,8 +37,6 @@ import { joinPath } from 'vs/base/common/resources';
interface IWindowConfiguration {
userDataUri: URI;
settingsUri: URI;
keybindingsUri: URI;
remoteAuthority: string;
folderUri?: URI;
workspaceUri?: URI;
@@ -123,7 +121,7 @@ class CodeRendererMain extends Disposable {
const payload = await this.resolveWorkspaceInitializationPayload();
await Promise.all([
this.createWorkspaceService(payload, fileService, remoteAgentService, logService).then(service => {
this.createWorkspaceService(payload, environmentService, fileService, remoteAgentService, logService).then(service => {
// Workspace
serviceCollection.set(IWorkspaceContextService, service);
@@ -143,8 +141,8 @@ class CodeRendererMain extends Disposable {
environmentService.appRoot = '/web/';
environmentService.args = { _: [] };
environmentService.appSettingsHome = joinPath(this.configuration.userDataUri, 'User');
environmentService.settingsResource = this.configuration.settingsUri;
environmentService.keybindingsResource = this.configuration.keybindingsUri;
environmentService.settingsResource = joinPath(environmentService.appSettingsHome, 'settings.json');
environmentService.keybindingsResource = joinPath(environmentService.appSettingsHome, 'keybindings.json');
environmentService.logsPath = '/web/logs';
environmentService.debugExtensionHost = {
port: null,
@@ -154,8 +152,8 @@ class CodeRendererMain extends Disposable {
return environmentService;
}
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);
private async createWorkspaceService(payload: IWorkspaceInitializationPayload, environmentService: IWorkbenchEnvironmentService, fileService: FileService, remoteAgentService: IRemoteAgentService, logService: ILogService): Promise<WorkspaceService> {
const workspaceService = new WorkspaceService({ userSettingsResource: environmentService.settingsResource, remoteAuthority: this.configuration.remoteAuthority, configurationCache: new ConfigurationCache() }, new ConfigurationFileService(fileService), remoteAgentService);
try {
await workspaceService.initialize(payload);
@@ -196,8 +194,6 @@ export interface IWindowConfigurationContents {
export function main(windowConfigurationContents: IWindowConfigurationContents): Promise<void> {
const windowConfiguration: IWindowConfiguration = {
userDataUri: toResource(windowConfigurationContents.userDataPath),
settingsUri: toResource(windowConfigurationContents.settingsPath),
keybindingsUri: toResource(windowConfigurationContents.keybindingsPath),
folderUri: windowConfigurationContents.folderPath ? toResource(windowConfigurationContents.folderPath) : undefined,
workspaceUri: windowConfigurationContents.workspacePath ? toResource(windowConfigurationContents.workspacePath) : undefined,
remoteAuthority: document.location.host