Support contextual top-level snippets#4910
Conversation
06595c6 to
4e904c8
Compare
|
So there's this funny thing, if the context ranges are too tight, then when typing it's possible to fall out of the edge of a range as the contexts won't follow invalid parses. This causes a lot of the existing tests to fail, as they put the cursor beyond the range of text. To partially get around this, I don't compare columns when determining whether a context range applies to the current range. This gets it to at pass the existing tests, without me having to manually correct the positions at each one. |
9b8705f to
e1100c4
Compare
In the pursuit of smarter completions, create context trees that can be used as masks for easier filtering of relevant completions based on the line number.
ae24477 to
56f6a5e
Compare
|
This PR is a bit much and does multiple things at the same time. If anyone is looking at this, I'm going to split it up so it's easier to review. |
|
@crtschin I asked @VeryMilkyJoe to review this PR, please ping them once you've split it up :) Otherwise, they'll look at this PR in the future. |
|
I've split this into #4969, which contains the nested context fixes, and a TBD follow-up that'll add the actual snippets. Please review that PR instead @VeryMilkyJoe whenever you have some time! |
Closes #4905.
Ended up going a bit in the rabbit hole. This adds top-level snippets and includes a bit better nested behavior in deducing the context of completion.