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

Handle error reporting of files when new file is created after its opened in editor #36271

Merged
merged 3 commits into from
Jan 25, 2020

Conversation

sheetalkamat
Copy link
Member

  • Before this change, if file that is open in editor was added or removed from directory, it would ignore that for re-computing list of files. But that meant if watch for file creation was invoked after file is opened, it wouldn't put that file into configured project. so instead of ignoring the watch all the time, we ignore it only if file is already attached to the project.
  • Now with this fix, the new file will correctly be updated to be part of configured project after project is delay updated. That meant when queuing the errors, project for new file was inferred project which wont contain the file after that project is updated. This was because when getErr is queued, file and project are computed.. The actual error checking happens after delay, but that means when changes happen before this invocation (such as watcher invoke to create the file) the updated project wont contain file since we are now correctly putting file in the right project. So instead of precomputing default project for the file, compute it at the time of checking to avoid using wrong project. Note that getErrorForProject wll still queue filename + project instead of just filename since we want to ensure to check errors in context of that project.
    Fixes Newly created files don't belong to ts-project #35794

src/server/editorServices.ts Show resolved Hide resolved
src/server/session.ts Show resolved Hide resolved
src/server/session.ts Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Newly created files don't belong to ts-project
3 participants