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(server): return the right range for the original source file of DTS #1604

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

ivanwonder
Copy link
Contributor

When the user tries to go to the definition that is in the DTS file,
the Angular LS will map it to the original source file. Because of
not updating the scriptInfo, the Angular LS returns the wrong range
of the definition.

@ivanwonder
Copy link
Contributor Author

I can't find a way to add a test for it. there is no way to convert lsp.Range which is made up of start and end positions to TypeScript's absolute offsets out of the server. and getting the content of a file by the fs is not a good way.

When the user tries to go to the definition that is in the DTS file,
the Angular LS will map it to the original source file. Because of
not updating the `scriptInfo`, the Angular LS returns the wrong range
of the definition.
@ivanwonder ivanwonder force-pushed the fix-rang-for-original-file branch from cbc4b72 to b826069 Compare January 27, 2022 11:03
@atscott atscott added action: merge Ready to merge target: patch This PR is targeted for the next patch release cla: yes labels Jan 27, 2022
@atscott atscott merged commit 9a5ecd9 into angular:master Jan 27, 2022
atscott pushed a commit that referenced this pull request Jan 27, 2022
…TS (#1604)

When the user tries to go to the definition that is in the DTS file,
the Angular LS will map it to the original source file. Because of
not updating the `scriptInfo`, the Angular LS returns the wrong range
of the definition.

(cherry picked from commit 9a5ecd9)
@ivanwonder ivanwonder deleted the fix-rang-for-original-file branch January 28, 2022 03:50
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge Ready to merge cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants