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 project / program roots in tsserver correctly #58562

Merged
merged 3 commits into from
May 20, 2024

Conversation

sheetalkamat
Copy link
Member

@sheetalkamat sheetalkamat commented May 17, 2024

Currently if file is from "d.ts" or ".ts" of the referenced project as root of the project but the project includes exact opposite of that (input or output respectively) then we have issues with where we incorrectly assume these root names to be part of project . It is obviously incorrect and that results in getting incorrect default project for the file and uses incorrect sourceFIle for the actual file name and incorrect results. Eg in the repro instead of getting results from "index.d.ts" it is gettting results from "index.ts" as it assumes its the same file.

With this fix we always ensure our rootFilesMap is holding correct scriptInfo and hence correct default project for output or input of referenced project file.

This fixes this issue.
Fixes #56254

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels May 17, 2024
@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.

@sheetalkamat sheetalkamat marked this pull request as ready for review May 20, 2024 18:07
@sheetalkamat sheetalkamat requested review from andrewbranch and jakebailey and removed request for andrewbranch May 20, 2024 18:07
@sheetalkamat sheetalkamat merged commit ba78807 into main May 20, 2024
28 checks passed
@sheetalkamat sheetalkamat deleted the semanticHighlighting branch May 20, 2024 18:45
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect semantic highlighting
3 participants