Skip to content

Commit 24c152a

Browse files
rschnekenbundoschek
authored andcommitted
fix: avoid trying to use watchman for file system watcher (#16335) (#16351)
fixes #14890 contributed on behalf of STMicroelectronics Signed-off-by: Remi Schnekenburger <[email protected]>
1 parent 8580762 commit 24c152a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/filesystem/src/node/parcel-watcher/parcel-filesystem-service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
import { FileChangeCollection } from '../file-change-collection';
2525
import { Deferred, timeout } from '@theia/core/lib/common/promise-util';
2626
import { subscribe, Options, AsyncSubscription, Event } from '@theia/core/shared/@parcel/watcher';
27+
import { isOSX, isWindows } from '@theia/core';
2728

2829
export interface ParcelWatcherOptions {
2930
ignored: Minimatch[]
@@ -109,6 +110,9 @@ export class ParcelWatcher {
109110
*/
110111
readonly whenStarted: Promise<boolean>;
111112

113+
// copied from https://github.com/microsoft/vscode/blob/e3a5acfb517a443235981655413d566533107e92/src/vs/platform/files/node/watcher/parcel/parcelWatcher.ts#L158
114+
private static readonly PARCEL_WATCHER_BACKEND = isWindows ? 'windows' : isOSX ? 'fs-events' : 'inotify';
115+
112116
constructor(
113117
/** Initial reference to this handle. */
114118
initialClientId: number,
@@ -255,6 +259,7 @@ export class ParcelWatcher {
255259
this.handleWatcherEvents(events);
256260
}
257261
}, {
262+
backend: ParcelWatcher.PARCEL_WATCHER_BACKEND,
258263
...this.parcelFileSystemWatchServerOptions.parcelOptions
259264
});
260265
}

0 commit comments

Comments
 (0)