Don't pollute completions with globals in templates with syntax errors #567
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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