Skip to content

Commit

Permalink
Fixes file watcher (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpaul-stripe authored Apr 10, 2024
1 parent 3f53a17 commit a4ba348
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/plugins/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ export default class Watch {
}

onContentChange(changes: FileWatchEvent[]) {
for (const change of changes)
for (const change of changes) {
const path = pathutil.join(this.config.root, change.path);
if (change.type === LSP.FileChangeType.Deleted)
this.services.Scanner.delete(change.path);
else this.services.Scanner.update(change.path);
this.services.Scanner.delete(path);
else this.services.Scanner.update(path);
}
}
}

0 comments on commit a4ba348

Please sign in to comment.