Skip to content

Commit

Permalink
Don't dispose of individual subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
pokey committed Oct 16, 2023
1 parent 03165ad commit c2a01d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
12 changes: 5 additions & 7 deletions packages/cursorless-vscode/src/ide/vscode/VscodeFileSystem.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Disposable, FileSystem, PathChangeListener } from "@cursorless/common";
import * as vscode from "vscode";
import { RelativePattern, workspace } from "vscode";

export class VscodeFileSystem implements FileSystem {
Expand All @@ -9,11 +8,10 @@ export class VscodeFileSystem implements FileSystem {
new RelativePattern(path, "**"),
);

return vscode.Disposable.from(
watcher,
watcher.onDidChange(onDidChange),
watcher.onDidCreate(onDidChange),
watcher.onDidDelete(onDidChange),
);
watcher.onDidChange(onDidChange);
watcher.onDidCreate(onDidChange);
watcher.onDidDelete(onDidChange);

return watcher;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,9 @@ function watchDir(
new vscode.RelativePattern(path, `**/*${CURSORLESS_HAT_SHAPES_SUFFIX}`),
);

return vscode.Disposable.from(
hatsDirWatcher,
hatsDirWatcher.onDidChange(onDidChange),
hatsDirWatcher.onDidCreate(onDidChange),
hatsDirWatcher.onDidDelete(onDidChange),
);
hatsDirWatcher.onDidChange(onDidChange);
hatsDirWatcher.onDidCreate(onDidChange);
hatsDirWatcher.onDidDelete(onDidChange);

return hatsDirWatcher;
}

0 comments on commit c2a01d8

Please sign in to comment.