Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/platform/files/node/watcher/watcherMain.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { DisposableStore } from '../../../../base/common/lifecycle.js';
7
import { ProxyChannel } from '../../../../base/parts/ipc/common/ipc.js';
8
import { Server as ChildProcessServer } from '../../../../base/parts/ipc/node/ipc.cp.js';
9
import { Server as UtilityProcessServer } from '../../../../base/parts/ipc/node/ipc.mp.js';
10
import { isUtilityProcess } from '../../../../base/parts/sandbox/node/electronTypes.js';
11
import { UniversalWatcher } from './watcher.js';
12
13
let server: ChildProcessServer<string> | UtilityProcessServer;
14
if (isUtilityProcess(process)) {
15
server = new UtilityProcessServer();
16
} else {
17
server = new ChildProcessServer('watcher');
18
}
19
20
const service = new UniversalWatcher();
21
server.registerChannel('watcher', ProxyChannel.fromService(service, new DisposableStore()));
22
23