kdcro101 / vscode-favorites

Add files and directories to workspace favorites. You can create groups (and subgroups) of favorite items with files and folders. Time saver for complex projects.
MIT License
49 stars 13 forks source link

Invalid favorites.json file makes extension go infinite progress bar #27

Closed Yanpas closed 5 years ago

Yanpas commented 5 years ago

Sometimes when I compile my project the load is high and if I update favorites.json it gets dumped to disc in several writes. If extension parses it when the file is not completely written. I see this: image

Solution: Extension should silently retry to load favorites.json several times and then report after some timeout that there was an error.

Easy to reproduce if I append some garbage to file with json

Yanpas commented 5 years ago

Although I'm not sure if fsWatcher is needed by this extension. By default it will receive all events from top directory. When some build happens inside project directory it consumes CPU for no reason

kdcro101 commented 5 years ago

When there is an error it resolves to an empty array. You can manually refresh favorites to force it to reload.

fsWatcher is needed (see #24) to refresh view when favorites contents are changed. Event handler is debounced so there is no excess CPU load.