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

Don't pollute completions with globals in templates with syntax errors #567

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

dfreeman
Copy link
Member

@dfreeman dfreeman commented Apr 28, 2023

We fixed this for many cases in #442, but had an outstanding issue with embedded templates.

The root of the problem was essentially that I didn't want to plumb a MappingTree through a few layers of function indirection, and so we were answering the "is this completion being requested within a template?" question in two passes. Unfortunately, in cases with template a syntax error where the template was in the same file as the backing class, the second pass lookup of the mapping tree would fail, because the transformed offset would fall directly on the border between the template and the real JS/TS code.

This change fixes my original sin and plumbs through the relevant MappingTree as part of the transformed offset lookup process.

Fixes #566

@dfreeman dfreeman added the bug Something isn't working label Apr 28, 2023
@dfreeman dfreeman merged commit ac451f3 into main Apr 28, 2023
@dfreeman dfreeman deleted the embedded-template-completions branch April 28, 2023 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arg completions incorrectly contain globals in .gts files
1 participant