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

Send configFileDiag event when presence of errors change on project.update #58120

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

sheetalkamat
Copy link
Member

@sheetalkamat sheetalkamat commented Apr 8, 2024

With this change we send configFileDiag when its a new program.
The need to add "skip" for this is because we have heuristics on when and how to send the configFileDiag when we open file so those operations just call with skip and do there own thing..

The main issue when looking into wsl2 repro was that when file is deleted:

  • file Delete event for that specific file is observed. and marked
  • file delete and add in the config file's folder is observed but on "linux' or "wsl2" it is delayed so we can send that event in batches.
  • Project gets updated as part of editor sending request to open file for renamed file with the new name - at this point the project only observes that old file name is deleted but because the wild card directory watcher is not invoked which updates root file names the root file names still contain old file name, So we sends configFileDiag that translates into vscode showing error: "missing old file"
  • The timer for updating directory watcher runs and sends event for updating root file names of the config file
  • We update the project and have no errors but without this fix we could never report that to vscode since its only reported when tsconfig reloads or new file opens and doesnt belong to project. Result stale error in the editor. With this change, at this project update we will send configFileDiag to vscode and this should clear the errors for the project. displayed

Fixes #57340

@typescript-bot
Copy link
Collaborator

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up.

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Apr 8, 2024
@sheetalkamat sheetalkamat marked this pull request as ready for review April 8, 2024 20:33
Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

Super super happy to have this fixed, has bugged me forever 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
4 participants