mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-30 12:15:32 +01:00
Merge branch 'main' into main
This commit is contained in:
@@ -1248,13 +1248,13 @@ export class CodeApplication extends Disposable {
|
||||
// Logging
|
||||
switch (type) {
|
||||
case WindowError.PROCESS_GONE:
|
||||
this.logService.error(`SharedProcess: renderer process gone (reason: ${details?.reason || '<unknown>'}, code: ${details?.exitCode || '<unknown>'})`);
|
||||
this.logService.error(`[SharedProcess] renderer process gone (reason: ${details?.reason || '<unknown>'}, code: ${details?.exitCode || '<unknown>'})`);
|
||||
break;
|
||||
case WindowError.UNRESPONSIVE:
|
||||
this.logService.error('SharedProcess: detected unresponsive');
|
||||
this.logService.error('[SharedProcess] detected unresponsive');
|
||||
break;
|
||||
case WindowError.LOAD:
|
||||
this.logService.error(`SharedProcess: failed to load (reason: ${details?.reason || '<unknown>'}, code: ${details?.exitCode || '<unknown>'})`);
|
||||
this.logService.error(`[SharedProcess] failed to load (reason: ${details?.reason || '<unknown>'}, code: ${details?.exitCode || '<unknown>'})`);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import { IPathWithLineAndColumn, isValidBasename, parseLineAndColumnAware, sanit
|
||||
import { once } from 'vs/base/common/functional';
|
||||
import { getPathLabel } from 'vs/base/common/labels';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { basename, join, resolve } from 'vs/base/common/path';
|
||||
import { basename, resolve } from 'vs/base/common/path';
|
||||
import { mark } from 'vs/base/common/performance';
|
||||
import { IProcessEnvironment, isMacintosh, isWindows, OS } from 'vs/base/common/platform';
|
||||
import { cwd } from 'vs/base/common/process';
|
||||
@@ -131,7 +131,7 @@ class CodeMain {
|
||||
});
|
||||
|
||||
// Delay creation of spdlog for perf reasons (https://github.com/microsoft/vscode/issues/72906)
|
||||
bufferLogService.logger = loggerService.createLogger(URI.file(join(environmentMainService.logsPath, 'main.log')), { id: 'mainLog', name: localize('mainLog', "Main") });
|
||||
bufferLogService.logger = loggerService.createLogger('main', { name: localize('mainLog', "Main") });
|
||||
|
||||
// Lifecycle
|
||||
once(lifecycleMainService.onWillShutdown)(evt => {
|
||||
@@ -162,7 +162,7 @@ class CodeMain {
|
||||
services.set(IEnvironmentMainService, environmentMainService);
|
||||
|
||||
// Logger
|
||||
const loggerService = new LoggerMainService(getLogLevel(environmentMainService));
|
||||
const loggerService = new LoggerMainService(getLogLevel(environmentMainService), environmentMainService.logsHome);
|
||||
services.set(ILoggerMainService, loggerService);
|
||||
|
||||
// Log: We need to buffer the spdlog logs until we are sure
|
||||
@@ -246,7 +246,7 @@ class CodeMain {
|
||||
Promise.all<string | undefined>([
|
||||
environmentMainService.extensionsPath,
|
||||
environmentMainService.codeCachePath,
|
||||
environmentMainService.logsPath,
|
||||
environmentMainService.logsHome.fsPath,
|
||||
userDataProfilesMainService.defaultProfile.globalStorageHome.fsPath,
|
||||
environmentMainService.workspaceStorageHome.fsPath,
|
||||
environmentMainService.localHistoryHome.fsPath,
|
||||
|
||||
@@ -23,7 +23,7 @@ import { isRemoteDiagnosticError, SystemInfo } from 'vs/platform/diagnostics/com
|
||||
import { ElectronIPCMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
|
||||
import { IssueReporterData, IssueReporterExtensionData, IssueReporterStyles, IssueReporterWindowConfiguration, IssueType } from 'vs/platform/issue/common/issue';
|
||||
import { normalizeGitHubUrl } from 'vs/platform/issue/common/issueReporterUtil';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { INativeHostService } from 'vs/platform/native/common/native';
|
||||
import { NativeHostService } from 'vs/platform/native/electron-sandbox/nativeHostService';
|
||||
import { applyZoom, zoomIn, zoomOut } from 'vs/platform/window/electron-sandbox/window';
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import { IRemoteDiagnosticError, isRemoteDiagnosticError } from 'vs/platform/dia
|
||||
import { ByteSize } from 'vs/platform/files/common/files';
|
||||
import { ElectronIPCMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
|
||||
import { ProcessExplorerData, ProcessExplorerStyles, ProcessExplorerWindowConfiguration } from 'vs/platform/issue/common/issue';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { INativeHostService } from 'vs/platform/native/common/native';
|
||||
import { NativeHostService } from 'vs/platform/native/electron-sandbox/nativeHostService';
|
||||
import { getIconsStyleSheet } from 'vs/platform/theme/browser/iconsStyleSheet';
|
||||
import { applyZoom, zoomIn, zoomOut } from 'vs/platform/window/electron-sandbox/window';
|
||||
@@ -163,7 +163,7 @@ class ErrorRenderer implements ITreeRenderer<IRemoteDiagnosticError, void, IProc
|
||||
|
||||
|
||||
class ProcessRenderer implements ITreeRenderer<ProcessItem, void, IProcessItemTemplateData> {
|
||||
constructor(private platform: string, private totalMem: number, private mapPidToWindowTitle: Map<number, string>) { }
|
||||
constructor(private platform: string, private totalMem: number, private mapPidToName: Map<number, string>) { }
|
||||
|
||||
templateId: string = 'process';
|
||||
renderTemplate(container: HTMLElement): IProcessItemTemplateData {
|
||||
@@ -179,13 +179,13 @@ class ProcessRenderer implements ITreeRenderer<ProcessItem, void, IProcessItemTe
|
||||
renderElement(node: ITreeNode<ProcessItem, void>, index: number, templateData: IProcessItemTemplateData, height: number | undefined): void {
|
||||
const { element } = node;
|
||||
|
||||
let name = element.name;
|
||||
if (name === 'window') {
|
||||
const windowTitle = this.mapPidToWindowTitle.get(element.pid);
|
||||
name = windowTitle !== undefined ? `${name} (${this.mapPidToWindowTitle.get(element.pid)})` : name;
|
||||
}
|
||||
const pid = element.pid.toFixed(0);
|
||||
|
||||
let name = element.name;
|
||||
if (this.mapPidToName.has(element.pid)) {
|
||||
name = this.mapPidToName.get(element.pid)!;
|
||||
}
|
||||
|
||||
templateData.name.textContent = name;
|
||||
templateData.name.title = element.cmd;
|
||||
|
||||
@@ -230,7 +230,7 @@ function isProcessItem(item: any): item is ProcessItem {
|
||||
class ProcessExplorer {
|
||||
private lastRequestTime: number;
|
||||
|
||||
private mapPidToWindowTitle = new Map<number, string>();
|
||||
private mapPidToName = new Map<number, string>();
|
||||
|
||||
private nativeHostService: INativeHostService;
|
||||
|
||||
@@ -243,10 +243,12 @@ class ProcessExplorer {
|
||||
this.applyStyles(data.styles);
|
||||
this.setEventHandlers(data);
|
||||
|
||||
// Map window process pids to titles, annotate process names with this when rendering to distinguish between them
|
||||
ipcRenderer.on('vscode:windowsInfoResponse', (event: unknown, windows: any[]) => {
|
||||
this.mapPidToWindowTitle = new Map<number, string>();
|
||||
windows.forEach(window => this.mapPidToWindowTitle.set(window.pid, window.title));
|
||||
ipcRenderer.on('vscode:pidToNameResponse', (event: unknown, pidToNames: [number, string][]) => {
|
||||
this.mapPidToName = new Map<number, string>();
|
||||
|
||||
for (const [pid, name] of pidToNames) {
|
||||
this.mapPidToName.set(pid, name);
|
||||
}
|
||||
});
|
||||
|
||||
ipcRenderer.on('vscode:listProcessesResponse', async (event: unknown, processRoots: MachineProcessInformation[]) => {
|
||||
@@ -267,7 +269,7 @@ class ProcessExplorer {
|
||||
});
|
||||
|
||||
this.lastRequestTime = Date.now();
|
||||
ipcRenderer.send('vscode:windowsInfoRequest');
|
||||
ipcRenderer.send('vscode:pidToNameRequest');
|
||||
ipcRenderer.send('vscode:listProcesses');
|
||||
}
|
||||
|
||||
@@ -304,7 +306,7 @@ class ProcessExplorer {
|
||||
const { totalmem } = await this.nativeHostService.getOSStatistics();
|
||||
|
||||
const renderers = [
|
||||
new ProcessRenderer(this.data.platform, totalmem, this.mapPidToWindowTitle),
|
||||
new ProcessRenderer(this.data.platform, totalmem, this.mapPidToName),
|
||||
new ProcessHeaderTreeRenderer(),
|
||||
new MachineRenderer(),
|
||||
new ErrorRenderer()
|
||||
@@ -556,7 +558,7 @@ class ProcessExplorer {
|
||||
|
||||
// Wait at least a second between requests.
|
||||
if (waited > 1000) {
|
||||
ipcRenderer.send('vscode:windowsInfoRequest');
|
||||
ipcRenderer.send('vscode:pidToNameRequest');
|
||||
ipcRenderer.send('vscode:listProcesses');
|
||||
} else {
|
||||
this.requestProcessList(waited);
|
||||
|
||||
@@ -39,8 +39,7 @@ import { InstantiationService } from 'vs/platform/instantiation/common/instantia
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||
import { NativeLanguagePackService } from 'vs/platform/languagePacks/node/languagePacks';
|
||||
import { ConsoleLogger, getLogLevel, ILogger, ILogService, LogLevel } from 'vs/platform/log/common/log';
|
||||
import { SpdLogLogger } from 'vs/platform/log/node/spdlogLog';
|
||||
import { ConsoleLogger, getLogLevel, ILogger, ILoggerService, ILogService, LogLevel } from 'vs/platform/log/common/log';
|
||||
import { FilePolicyService } from 'vs/platform/policy/common/filePolicyService';
|
||||
import { IPolicyService, NullPolicyService } from 'vs/platform/policy/common/policy';
|
||||
import { NativePolicyService } from 'vs/platform/policy/node/nativePolicyService';
|
||||
@@ -62,6 +61,8 @@ import { UserDataProfilesReadonlyService } from 'vs/platform/userDataProfile/nod
|
||||
import { resolveMachineId } from 'vs/platform/telemetry/node/telemetryUtils';
|
||||
import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService';
|
||||
import { LogService } from 'vs/platform/log/common/logService';
|
||||
import { LoggerService } from 'vs/platform/log/node/loggerService';
|
||||
import { localize } from 'vs/nls';
|
||||
|
||||
class CliMain extends Disposable {
|
||||
|
||||
@@ -124,15 +125,18 @@ class CliMain extends Disposable {
|
||||
environmentService.extensionsPath
|
||||
].map(path => path ? Promises.mkdir(path, { recursive: true }) : undefined));
|
||||
|
||||
// Logger
|
||||
const loggerService = new LoggerService(getLogLevel(environmentService), environmentService.logsHome);
|
||||
services.set(ILoggerService, loggerService);
|
||||
|
||||
// Log
|
||||
const logLevel = getLogLevel(environmentService);
|
||||
const spdLogLogger = new SpdLogLogger('cli', join(environmentService.logsPath, 'cli.log'), true, false, logLevel);
|
||||
const logger = this._register(loggerService.createLogger('cli', { name: localize('cli', "CLI") }));
|
||||
const otherLoggers: ILogger[] = [];
|
||||
if (logLevel === LogLevel.Trace) {
|
||||
otherLoggers.push(new ConsoleLogger(logLevel));
|
||||
if (loggerService.getLogLevel() === LogLevel.Trace) {
|
||||
otherLoggers.push(new ConsoleLogger(loggerService.getLogLevel()));
|
||||
}
|
||||
|
||||
const logService = this._register(new LogService(spdLogLogger, otherLoggers));
|
||||
const logService = this._register(new LogService(logger, otherLoggers));
|
||||
services.set(ILogService, logService);
|
||||
|
||||
// Files
|
||||
@@ -142,8 +146,6 @@ class CliMain extends Disposable {
|
||||
const diskFileSystemProvider = this._register(new DiskFileSystemProvider(logService));
|
||||
fileService.registerProvider(Schemas.file, diskFileSystemProvider);
|
||||
|
||||
// State
|
||||
|
||||
// Uri Identity
|
||||
const uriIdentityService = new UriIdentityService(fileService);
|
||||
services.set(IUriIdentityService, uriIdentityService);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { basename, dirname, join } from 'vs/base/common/path';
|
||||
import { basename, dirname, joinPath } from 'vs/base/common/resources';
|
||||
import { Promises } from 'vs/base/node/pfs';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
@@ -29,10 +29,10 @@ export class LogsDataCleaner extends Disposable {
|
||||
this.logService.trace('[logs cleanup]: Starting to clean up old logs.');
|
||||
|
||||
try {
|
||||
const currentLog = basename(this.environmentService.logsPath);
|
||||
const logsRoot = dirname(this.environmentService.logsPath);
|
||||
const currentLog = basename(this.environmentService.logsHome);
|
||||
const logsRoot = dirname(this.environmentService.logsHome);
|
||||
|
||||
const logFiles = await Promises.readdir(logsRoot);
|
||||
const logFiles = await Promises.readdir(logsRoot.fsPath);
|
||||
|
||||
const allSessions = logFiles.filter(logFile => /^\d{8}T\d{6}$/.test(logFile));
|
||||
const oldSessions = allSessions.sort().filter(session => session !== currentLog);
|
||||
@@ -41,7 +41,7 @@ export class LogsDataCleaner extends Disposable {
|
||||
if (sessionsToDelete.length > 0) {
|
||||
this.logService.trace(`[logs cleanup]: Removing log folders '${sessionsToDelete.join(', ')}'`);
|
||||
|
||||
await Promise.all(sessionsToDelete.map(sessionToDelete => Promises.rm(join(logsRoot, sessionToDelete))));
|
||||
await Promise.all(sessionsToDelete.map(sessionToDelete => Promises.rm(joinPath(logsRoot, sessionToDelete).fsPath)));
|
||||
}
|
||||
} catch (error) {
|
||||
onUnexpectedError(error);
|
||||
|
||||
@@ -13,11 +13,8 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { StorageClient } from 'vs/platform/storage/common/storageIpc';
|
||||
import { EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE } from 'vs/platform/workspace/common/workspace';
|
||||
import { NON_EMPTY_WORKSPACE_ID_LENGTH } from 'vs/platform/workspaces/node/workspaces';
|
||||
|
||||
/* eslint-disable local/code-layering, local/code-import-patterns */
|
||||
// TODO@bpasero layer is not allowed in utility process
|
||||
import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { INativeHostService } from 'vs/platform/native/common/native';
|
||||
import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService';
|
||||
|
||||
export class UnusedWorkspaceStorageDataCleaner extends Disposable {
|
||||
|
||||
|
||||
@@ -3,12 +3,17 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* eslint-disable local/code-layering, local/code-import-patterns */
|
||||
// TODO@bpasero remove these once utility process is the only way
|
||||
import { Server as BrowserWindowMessagePortServer } from 'vs/base/parts/ipc/electron-browser/ipc.mp';
|
||||
import { SharedProcessWorkerService } from 'vs/platform/sharedProcess/electron-browser/sharedProcessWorkerService';
|
||||
import { ILocalPtyService } from 'vs/platform/terminal/electron-sandbox/terminal';
|
||||
|
||||
import { hostname, release } from 'os';
|
||||
import { toErrorMessage } from 'vs/base/common/errorMessage';
|
||||
import { onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors';
|
||||
import { combinedDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { joinPath } from 'vs/base/common/resources';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IPCServer, ProxyChannel, StaticRouter } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { Server as UtilityProcessMessagePortServer, once } from 'vs/base/parts/ipc/node/ipc.mp';
|
||||
@@ -72,6 +77,7 @@ import { UserDataSyncService } from 'vs/platform/userDataSync/common/userDataSyn
|
||||
import { UserDataSyncChannel } from 'vs/platform/userDataSync/common/userDataSyncServiceIpc';
|
||||
import { UserDataSyncStoreManagementService, UserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSyncStoreService';
|
||||
import { IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService';
|
||||
import { NativeUserDataProfileStorageService } from 'vs/platform/userDataProfile/node/userDataProfileStorageService';
|
||||
import { ActiveWindowManager } from 'vs/platform/windows/node/windowTracker';
|
||||
import { ISignService } from 'vs/platform/sign/common/sign';
|
||||
import { SignService } from 'vs/platform/sign/node/signService';
|
||||
@@ -103,24 +109,16 @@ import { localize } from 'vs/nls';
|
||||
import { LogService } from 'vs/platform/log/common/logService';
|
||||
import { ipcUtilityProcessWorkerChannelName, IUtilityProcessWorkerConfiguration } from 'vs/platform/utilityProcess/common/utilityProcessWorkerService';
|
||||
import { isUtilityProcess } from 'vs/base/parts/sandbox/node/electronTypes';
|
||||
|
||||
/* eslint-disable local/code-layering, local/code-import-patterns */
|
||||
// TODO@bpasero layer is not allowed in utility process
|
||||
import { Server as BrowserWindowMessagePortServer } from 'vs/base/parts/ipc/electron-browser/ipc.mp';
|
||||
import { ExtensionTipsService } from 'vs/platform/extensionManagement/electron-sandbox/extensionTipsService';
|
||||
import { ExtensionRecommendationNotificationServiceChannelClient } from 'vs/platform/extensionRecommendations/electron-sandbox/extensionRecommendationsIpc';
|
||||
import { MessagePortMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService';
|
||||
import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { NativeStorageService } from 'vs/platform/storage/electron-sandbox/storageService';
|
||||
import { ILocalPtyService } from 'vs/platform/terminal/electron-sandbox/terminal';
|
||||
import { UserDataAutoSyncService } from 'vs/platform/userDataSync/electron-sandbox/userDataAutoSyncService';
|
||||
import { UserDataProfileStorageService } from 'vs/platform/userDataProfile/electron-sandbox/userDataProfileStorageService';
|
||||
import { SharedProcessWorkerService } from 'vs/platform/sharedProcess/electron-browser/sharedProcessWorkerService';
|
||||
import { SharedProcessRequestService } from 'vs/platform/request/electron-browser/sharedProcessRequestService';
|
||||
import { RemoteTunnelService } from 'vs/platform/remoteTunnel/electron-browser/remoteTunnelService';
|
||||
import { ISharedProcessLifecycleService, SharedProcessLifecycleService } from 'vs/platform/lifecycle/electron-browser/sharedProcessLifecycleService';
|
||||
import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/electron-sandbox/extensionsProfileScannerService';
|
||||
import { ISharedProcessLifecycleService, SharedProcessLifecycleService } from 'vs/platform/lifecycle/node/sharedProcessLifecycleService';
|
||||
import { RemoteTunnelService } from 'vs/platform/remoteTunnel/node/remoteTunnelService';
|
||||
import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService';
|
||||
import { RequestChannelClient } from 'vs/platform/request/common/requestIpc';
|
||||
import { ExtensionRecommendationNotificationServiceChannelClient } from 'vs/platform/extensionRecommendations/common/extensionRecommendationsIpc';
|
||||
import { INativeHostService } from 'vs/platform/native/common/native';
|
||||
import { UserDataAutoSyncService } from 'vs/platform/userDataSync/node/userDataAutoSyncService';
|
||||
import { ExtensionTipsService } from 'vs/platform/extensionManagement/node/extensionTipsService';
|
||||
import { IMainProcessService, MainProcessService } from 'vs/platform/ipc/common/mainProcessService';
|
||||
import { RemoteStorageService } from 'vs/platform/storage/common/storageService';
|
||||
|
||||
class SharedProcessMain extends Disposable {
|
||||
|
||||
@@ -145,9 +143,14 @@ class SharedProcessMain extends Disposable {
|
||||
private registerListeners(): void {
|
||||
|
||||
// Shared process lifecycle
|
||||
const onExit = async () => {
|
||||
this.lifecycleService?.fireOnWillShutdown();
|
||||
this.dispose();
|
||||
let didExit = false;
|
||||
const onExit = () => {
|
||||
if (!didExit) {
|
||||
didExit = true;
|
||||
|
||||
this.lifecycleService?.fireOnWillShutdown();
|
||||
this.dispose();
|
||||
}
|
||||
};
|
||||
process.once('exit', onExit);
|
||||
if (isUtilityProcess(process)) {
|
||||
@@ -217,7 +220,7 @@ class SharedProcessMain extends Disposable {
|
||||
|
||||
// Main Process
|
||||
const mainRouter = new StaticRouter(ctx => ctx === 'main');
|
||||
const mainProcessService = new MessagePortMainProcessService(this.server, mainRouter);
|
||||
const mainProcessService = new MainProcessService(this.server, mainRouter);
|
||||
services.set(IMainProcessService, mainProcessService);
|
||||
|
||||
// Policies
|
||||
@@ -229,11 +232,11 @@ class SharedProcessMain extends Disposable {
|
||||
services.set(INativeEnvironmentService, environmentService);
|
||||
|
||||
// Logger
|
||||
const loggerService = new LoggerChannelClient(undefined, this.configuration.logLevel, this.configuration.loggers.map(loggerResource => ({ ...loggerResource, resource: URI.revive(loggerResource.resource) })), mainProcessService.getChannel('logger'));
|
||||
const loggerService = new LoggerChannelClient(undefined, this.configuration.logLevel, environmentService.logsHome, this.configuration.loggers.map(loggerResource => ({ ...loggerResource, resource: URI.revive(loggerResource.resource) })), mainProcessService.getChannel('logger'));
|
||||
services.set(ILoggerService, loggerService);
|
||||
|
||||
// Log
|
||||
const logger = this._register(loggerService.createLogger(joinPath(URI.file(environmentService.logsPath), 'sharedprocess.log'), { id: 'sharedLog', name: localize('sharedLog', "Shared") }));
|
||||
const logger = this._register(loggerService.createLogger('sharedprocess', { name: localize('sharedLog', "Shared") }));
|
||||
const consoleLogger = this._register(new ConsoleLogger(logger.getLevel()));
|
||||
const logService = this._register(new LogService(logger, [consoleLogger]));
|
||||
services.set(ILogService, logService);
|
||||
@@ -266,7 +269,7 @@ class SharedProcessMain extends Disposable {
|
||||
fileService.registerProvider(Schemas.vscodeUserData, userDataFileSystemProvider);
|
||||
|
||||
// User Data Profiles
|
||||
const userDataProfilesService = this._register(new UserDataProfilesService(this.configuration.profiles.all, URI.revive(this.configuration.profiles.home), mainProcessService.getChannel('userDataProfiles')));
|
||||
const userDataProfilesService = this._register(new UserDataProfilesService(this.configuration.profiles.all, URI.revive(this.configuration.profiles.home).with({ scheme: environmentService.userRoamingDataHome.scheme }), mainProcessService.getChannel('userDataProfiles')));
|
||||
services.set(IUserDataProfilesService, userDataProfilesService);
|
||||
|
||||
// Configuration
|
||||
@@ -274,7 +277,7 @@ class SharedProcessMain extends Disposable {
|
||||
services.set(IConfigurationService, configurationService);
|
||||
|
||||
// Storage (global access only)
|
||||
const storageService = new NativeStorageService(undefined, { defaultProfile: userDataProfilesService.defaultProfile, currentProfile: userDataProfilesService.defaultProfile }, mainProcessService, environmentService);
|
||||
const storageService = new RemoteStorageService(undefined, { defaultProfile: userDataProfilesService.defaultProfile, currentProfile: userDataProfilesService.defaultProfile }, mainProcessService, environmentService);
|
||||
services.set(IStorageService, storageService);
|
||||
this._register(toDisposable(() => storageService.flush()));
|
||||
|
||||
@@ -289,7 +292,7 @@ class SharedProcessMain extends Disposable {
|
||||
services.set(IUriIdentityService, uriIdentityService);
|
||||
|
||||
// Request
|
||||
services.set(IRequestService, new SharedProcessRequestService(mainProcessService, configurationService, logService));
|
||||
services.set(IRequestService, new RequestChannelClient(mainProcessService.getChannel('request')));
|
||||
|
||||
// Checksum
|
||||
services.set(IChecksumService, new SyncDescriptor(ChecksumService, undefined, false /* proxied to other processes */));
|
||||
@@ -373,7 +376,7 @@ class SharedProcessMain extends Disposable {
|
||||
services.set(IUserDataSyncBackupStoreService, new SyncDescriptor(UserDataSyncBackupStoreService, undefined, false /* Eagerly cleans up old backups */));
|
||||
services.set(IUserDataSyncEnablementService, new SyncDescriptor(UserDataSyncEnablementService, undefined, true));
|
||||
services.set(IUserDataSyncService, new SyncDescriptor(UserDataSyncService, undefined, false /* Initializes the Sync State */));
|
||||
services.set(IUserDataProfileStorageService, new SyncDescriptor(UserDataProfileStorageService, undefined, true));
|
||||
services.set(IUserDataProfileStorageService, new SyncDescriptor(NativeUserDataProfileStorageService, undefined, true));
|
||||
services.set(IUserDataSyncResourceProviderService, new SyncDescriptor(UserDataSyncResourceProviderService, undefined, true));
|
||||
|
||||
// Terminal
|
||||
@@ -383,7 +386,7 @@ class SharedProcessMain extends Disposable {
|
||||
shortGraceTime: LocalReconnectConstants.ShortGraceTime,
|
||||
scrollback: configurationService.getValue<number>(TerminalSettingId.PersistentSessionScrollback) ?? 100
|
||||
},
|
||||
localize('ptyHost', "Pty Host"),
|
||||
false,
|
||||
configurationService,
|
||||
environmentService,
|
||||
logService,
|
||||
|
||||
Reference in New Issue
Block a user