Path: blob/main/src/vs/platform/files/node/watcher/watcherMain.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { DisposableStore } from '../../../../base/common/lifecycle.js';6import { ProxyChannel } from '../../../../base/parts/ipc/common/ipc.js';7import { Server as ChildProcessServer } from '../../../../base/parts/ipc/node/ipc.cp.js';8import { Server as UtilityProcessServer } from '../../../../base/parts/ipc/node/ipc.mp.js';9import { isUtilityProcess } from '../../../../base/parts/sandbox/node/electronTypes.js';10import { UniversalWatcher } from './watcher.js';1112let server: ChildProcessServer<string> | UtilityProcessServer;13if (isUtilityProcess(process)) {14server = new UtilityProcessServer();15} else {16server = new ChildProcessServer('watcher');17}1819const service = new UniversalWatcher();20server.registerChannel('watcher', ProxyChannel.fromService(service, new DisposableStore()));212223