Skip to content
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

Fix: applied comment directive error suppressions to program diagnostics #51777

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JoshuaKGoldberg
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg commented Dec 6, 2022

Fixes #48850

I'm not 100% happy with with this solution. programDiagnostics.getDiagnostics(sourceFile.fileName) is now getting called twice under getSemanticDiagnosticsForFile:

  1. getBindAndCheckDiagnosticsForFile > getBindAndCheckDiagnosticsForFileNoCache > getMergedBindAndCheckDiagnostics
  2. getProgramDiagnostics

...however, I'm under the impression files mostly never have more than a few program diagnostics, so the cost of computing that map should be small? If that's the case then this feels like a pretty clean solution, optimizing for the least amount of added code?

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Dec 6, 2022
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ts-expect-error is reported as unused on rootDir error
2 participants