-
Notifications
You must be signed in to change notification settings - Fork 583
Fix some bugs in tsc -w
#781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
internal/execute/watcher.go:53
- Using reflect.DeepEqual may incur performance costs in a hot path. Consider a custom, efficient comparison function if CompilerOptions is large or performance sensitive.
if !reflect.DeepEqual(w.options.CompilerOptions(), configParseResult.CompilerOptions()) {
internal/execute/watcher.go:82
- The unconditional deletion of the file from w.prevModified might change the intended logic compared to the previous conditional deletion. Verify that this logic change is intentional and correctly handles all scenarios.
delete(w.prevModified, fileName)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Yes, it was supposed to be a deep equals for the compileroptions.
Ive requested changes for the other change since it was a small optimization i made earlier
internal/execute/watcher.go
Outdated
} | ||
delete(w.prevModified, fileName) | ||
} | ||
delete(w.prevModified, fileName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was intentional to leave this inside the if !filesModified
block, since the deletion only matters if filesModified == false
. You could add this reasoning into a comment in the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
fixes #778
cc @iisaduan @jakebailey