mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-08 18:08:33 +00:00
feat: use theia@1.57.0 (#2654)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { join } from 'node:path';
|
||||
import { interfaces } from '@theia/core/shared/inversify';
|
||||
import {
|
||||
FileSystemWatcherServiceProcessOptions,
|
||||
WATCHER_SINGLE_THREADED,
|
||||
spawnParcelFileSystemWatcherServiceProcess,
|
||||
} from '@theia/filesystem/lib/node/filesystem-backend-module';
|
||||
import { FileSystemWatcherService } from '@theia/filesystem/lib/common/filesystem-watcher-protocol';
|
||||
import { ParcelFileSystemWatcherServerOptions } from '@theia/filesystem/lib/node/parcel-watcher/parcel-filesystem-service';
|
||||
import { FileSystemWatcherServiceDispatcher } from '@theia/filesystem/lib/node/filesystem-watcher-dispatcher';
|
||||
import { NoDelayDisposalTimeoutParcelFileSystemWatcherService } from './parcel-watcher/parcel-filesystem-service';
|
||||
|
||||
export function rebindParcelFileSystemWatcher(rebind: interfaces.Rebind): void {
|
||||
rebind<FileSystemWatcherServiceProcessOptions>(
|
||||
FileSystemWatcherServiceProcessOptions
|
||||
).toConstantValue({
|
||||
entryPoint: join(__dirname, 'parcel-watcher'),
|
||||
});
|
||||
rebind<FileSystemWatcherService>(FileSystemWatcherService)
|
||||
.toDynamicValue((context) =>
|
||||
WATCHER_SINGLE_THREADED
|
||||
? createParcelFileSystemWatcherService(context)
|
||||
: spawnParcelFileSystemWatcherServiceProcess(context)
|
||||
)
|
||||
.inSingletonScope();
|
||||
}
|
||||
|
||||
function createParcelFileSystemWatcherService({
|
||||
container,
|
||||
}: interfaces.Context): FileSystemWatcherService {
|
||||
const options = container.get<ParcelFileSystemWatcherServerOptions>(
|
||||
ParcelFileSystemWatcherServerOptions
|
||||
);
|
||||
const dispatcher = container.get<FileSystemWatcherServiceDispatcher>(
|
||||
FileSystemWatcherServiceDispatcher
|
||||
);
|
||||
const server = new NoDelayDisposalTimeoutParcelFileSystemWatcherService(
|
||||
options
|
||||
);
|
||||
server.setClient(dispatcher);
|
||||
return server;
|
||||
}
|
||||
Reference in New Issue
Block a user