Skip to content

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

Merged
merged 4 commits into from
Apr 13, 2025
Merged

Fix some bugs in tsc -w #781

merged 4 commits into from
Apr 13, 2025

Conversation

tmm1
Copy link
Contributor

@tmm1 tmm1 commented Apr 9, 2025

tmm1 added 3 commits April 8, 2025 20:47

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@Copilot Copilot AI review requested due to automatic review settings April 9, 2025 03:48
Copy link
Contributor

@Copilot Copilot AI left a 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)

@jakebailey jakebailey requested a review from iisaduan April 9, 2025 17:12
Copy link
Member

@iisaduan iisaduan left a 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

Comment on lines 80 to 82
}
delete(w.prevModified, fileName)
}
delete(w.prevModified, fileName)
Copy link
Member

@iisaduan iisaduan Apr 12, 2025

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

Unverified

This user has not yet uploaded their public signing key.
Copy link
Member

@iisaduan iisaduan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@iisaduan iisaduan added this pull request to the merge queue Apr 13, 2025
Merged via the queue into microsoft:main with commit 435391a Apr 13, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] watch mode triggers continuously
2 participants