Skip to content

Commit

Permalink
Fix a file watcher caching regression from 0.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rewrking committed Feb 15, 2024
1 parent 0c813b7 commit a00eb0e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## Version 0.7.5

- Fix a file watcher caching regression from 0.7.4

## Version 0.7.4

- If a workspace contains both a yaml and json build file, favor the json file to match the behavior of the Chalet executable
Expand Down
2 changes: 1 addition & 1 deletion Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-chalet",
"displayName": "Chalet",
"description": "Support for Chalet projects in Visual Studio Code",
"version": "0.7.4",
"version": "0.7.5",
"publisher": "chalet-org",
"license": "BSD-3-Clause",
"icon": "chalet-logo.png",
Expand Down
14 changes: 8 additions & 6 deletions Extension/src/ChaletToolsLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,17 @@ class ChaletToolsLoader {
return file;
};

private watchChaletFile2 = (file: string, listener: (curr: fs.Stats, prev: fs.Stats) => void): string => {
const interval: number = 1000;
fs.watchFile(file, { interval }, listener);
private inputFiles: string[] = [];
private watchers: string[] = [];

return file;
private watchChaletFile2 = (file: string, listener: (curr: fs.Stats, prev: fs.Stats) => void): void => {
if (!this.watchers.includes(file)) {
const interval: number = 1000;
fs.watchFile(file, { interval }, listener);
this.watchers.push(file);
}
};

private inputFiles: string[] = [];

private activate = async (workspaceFolder?: vscode.WorkspaceFolder): Promise<void> => {
try {
if (!workspaceFolder) {
Expand Down

0 comments on commit a00eb0e

Please sign in to comment.