mirror of
https://github.com/coder/code-server.git
synced 2026-05-08 21:37:27 +02:00
chore(vscode): update to 1.54.2
This commit is contained in:
@@ -18,17 +18,18 @@ import { NativeWorkbenchEnvironmentService } from 'vs/workbench/services/environ
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { INativeWorkbenchConfiguration, INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { IWorkspaceInitializationPayload, reviveIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IWorkspaceInitializationPayload, reviveIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { ILoggerService, ILogService } from 'vs/platform/log/common/log';
|
||||
import { NativeStorageService } from 'vs/platform/storage/node/storageService';
|
||||
import { NativeStorageService2 } from 'vs/platform/storage/electron-sandbox/storageService2';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { GlobalStorageDatabaseChannelClient } from 'vs/platform/storage/node/storageIpc';
|
||||
import { StorageDatabaseChannelClient } from 'vs/platform/storage/common/storageIpc';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkbenchConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { registerWindowDriver } from 'vs/platform/driver/electron-browser/driver';
|
||||
import { IMainProcessService, ElectronIPCMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
|
||||
import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services';
|
||||
import { RemoteAuthorityResolverService } from 'vs/platform/remote/electron-sandbox/remoteAuthorityResolverService';
|
||||
import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver';
|
||||
import { RemoteAgentService } from 'vs/workbench/services/remote/electron-sandbox/remoteAgentServiceImpl';
|
||||
@@ -44,13 +45,15 @@ import { FileUserDataProvider } from 'vs/workbench/services/userData/common/file
|
||||
import { basename } from 'vs/base/common/path';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { NativeLogService } from 'vs/workbench/services/log/electron-browser/logService';
|
||||
import { NativeLogService } from 'vs/workbench/services/log/electron-sandbox/logService';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { NativeHostService } from 'vs/platform/native/electron-sandbox/nativeHostService';
|
||||
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
|
||||
import { UriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentityService';
|
||||
import { KeyboardLayoutService } from 'vs/workbench/services/keybinding/electron-sandbox/nativeKeyboardLayout';
|
||||
import { IKeyboardLayoutService } from 'vs/platform/keyboardLayout/common/keyboardLayout';
|
||||
import { ElectronIPCMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
|
||||
import { LoggerChannelClient } from 'vs/platform/log/common/logIpc';
|
||||
|
||||
class DesktopMain extends Disposable {
|
||||
|
||||
@@ -81,7 +84,10 @@ class DesktopMain extends Disposable {
|
||||
private reviveUris() {
|
||||
|
||||
// Workspace
|
||||
this.configuration.workspace = reviveIdentifier(this.configuration.workspace);
|
||||
const workspace = reviveIdentifier(this.configuration.workspace);
|
||||
if (isWorkspaceIdentifier(workspace) || isSingleFolderWorkspaceIdentifier(workspace)) {
|
||||
this.configuration.workspace = workspace;
|
||||
}
|
||||
|
||||
// Files
|
||||
const filesToWait = this.configuration.filesToWait;
|
||||
@@ -128,14 +134,14 @@ class DesktopMain extends Disposable {
|
||||
services.logService.trace('workbench configuration', JSON.stringify(this.configuration));
|
||||
}
|
||||
|
||||
private registerListeners(workbench: Workbench, storageService: NativeStorageService): void {
|
||||
private registerListeners(workbench: Workbench, storageService: NativeStorageService | NativeStorageService2): void {
|
||||
|
||||
// Workbench Lifecycle
|
||||
this._register(workbench.onShutdown(() => this.dispose()));
|
||||
this._register(workbench.onWillShutdown(event => event.join(storageService.close(), 'join.closeStorage')));
|
||||
this._register(workbench.onShutdown(() => this.dispose()));
|
||||
}
|
||||
|
||||
private async initServices(): Promise<{ serviceCollection: ServiceCollection, logService: ILogService, storageService: NativeStorageService }> {
|
||||
private async initServices(): Promise<{ serviceCollection: ServiceCollection, logService: ILogService, storageService: NativeStorageService | NativeStorageService2 }> {
|
||||
const serviceCollection = new ServiceCollection();
|
||||
|
||||
|
||||
@@ -163,8 +169,12 @@ class DesktopMain extends Disposable {
|
||||
// Product
|
||||
serviceCollection.set(IProductService, this.productService);
|
||||
|
||||
// Logger
|
||||
const loggerService = new LoggerChannelClient(mainProcessService.getChannel('logger'));
|
||||
serviceCollection.set(ILoggerService, loggerService);
|
||||
|
||||
// Log
|
||||
const logService = this._register(new NativeLogService(this.configuration.windowId, mainProcessService, this.environmentService));
|
||||
const logService = this._register(new NativeLogService(`renderer${this.configuration.windowId}`, loggerService, mainProcessService, this.environmentService));
|
||||
serviceCollection.set(ILogService, logService);
|
||||
|
||||
// Remote
|
||||
@@ -313,12 +323,17 @@ class DesktopMain extends Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
private async createStorageService(payload: IWorkspaceInitializationPayload, logService: ILogService, mainProcessService: IMainProcessService): Promise<NativeStorageService> {
|
||||
const globalStorageDatabase = new GlobalStorageDatabaseChannelClient(mainProcessService.getChannel('storage'));
|
||||
const storageService = new NativeStorageService(globalStorageDatabase, logService, this.environmentService);
|
||||
private async createStorageService(payload: IWorkspaceInitializationPayload, logService: ILogService, mainProcessService: IMainProcessService): Promise<NativeStorageService | NativeStorageService2> {
|
||||
let storageService: NativeStorageService | NativeStorageService2;
|
||||
if (this.configuration.enableExperimentalMainProcessWorkspaceStorage) {
|
||||
storageService = new NativeStorageService2(payload, mainProcessService, this.environmentService);
|
||||
} else {
|
||||
const storageDataBaseClient = new StorageDatabaseChannelClient(mainProcessService.getChannel('storage'), payload);
|
||||
storageService = new NativeStorageService(storageDataBaseClient.globalStorage, payload, logService, this.environmentService);
|
||||
}
|
||||
|
||||
try {
|
||||
await storageService.initialize(payload);
|
||||
await storageService.initialize();
|
||||
|
||||
return storageService;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user