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

Avoid covering up scopes at boundaries of injection layers #19738

merged 3 commits into from Aug 2, 2019


Copy link

commented Aug 1, 2019

This is a possible fix to #19582 (comment), mostly solved by @as-cii.

@as-cii I tweaked the implementation to use the syntax Tree instead of the buffer range to detect whether an iterator is at the start of end of its injection.

My concern about using the range is that the layers' ranges can change over time as the document is edited, so if we store a range property, it can become stale. I think that we can achieve a similar result by checking if we're parked at the start or end of the root node of the syntax tree.

I think there are still there are theoretically cases where we might erroneously cover scope boundaries with this logic, and we should probably be even more restrictive about when we cover scope boundaries, but I can't think of a concrete case where they would occur, so I think this idea is a good way to fix the problem we're currently seeing.

@as-cii as-cii merged commit b4971d0 into master Aug 2, 2019

1 check passed

Atom Pull Requests #20190802.1 succeeded

@as-cii as-cii deleted the mb-injection-endpoints branch Aug 2, 2019


This comment has been minimized.

Copy link

commented Aug 2, 2019

Thanks for polishing this up, @maxbrunsfeld! ⚡️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.