Fix infinite loop on state refresh
[?]
Dec 28, 2020, 4:26 AM
YPHDYP3LZIQDWKGSFYGMQEGXKVSX3NKBJTSYVTCJ7ZIJTA36FAQACDependencies
- [2]
WHQQV5QQAdd watcher to refresh on file system changes - [3]
B4SKYP3YAdd repository model and add steps to initialize it - [4]
MU6ZNUYZIntegrate recordAll command with input box
Change contents
- replacement in src/repository.ts at line 4
import { anyEvent } from './utils/eventUtils';import { anyEvent, filterEvent } from './utils/eventUtils'; - edit in src/repository.ts at line 17
public onDidChangeWorkspace: Event<Uri>;public onDidCreateWorkspace: Event<Uri>;public onDidDeleteWorkspace: Event<Uri>;public onDidAnyWorkspace: Event<Uri>; - edit in src/repository.ts at line 64
const dotFolderPattern = /[\\/]\.pijul[\\/]/;const ignoreDotFolder = (uri: Uri): boolean => !dotFolderPattern.test(uri.path);this.onDidChangeWorkspace = filterEvent(this.onDidChange, ignoreDotFolder);this.onDidCreateWorkspace = filterEvent(this.onDidCreate, ignoreDotFolder);this.onDidDeleteWorkspace = filterEvent(this.onDidDelete, ignoreDotFolder); - replacement in src/repository.ts at line 72
this.onDidAny(this.onAnyRepositoryFileChange, this, this.disposables);this.onDidAnyWorkspace = anyEvent(this.onDidChangeWorkspace,this.onDidCreateWorkspace,this.onDidDeleteWorkspace);// This must run on the Workspace event, as the `pijul ls` command will trigger an infinite loop otherwise.this.onDidAnyWorkspace(this.onAnyRepositoryFileChange, this, this.disposables); - edit in src/repository.ts at line 86
/*** Watcher function which refreshes the extension's state when the files in the* repository change.*/