Be willing to complete in the face of emptiness #772
+14
−0
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.
Fixes #770
Note that this layers on top of #805 which should be merged first. This PR currently targets that branch instead of
main
to make this clear.See the last "move" in #805 (comment) for a concrete illustration of what this PR does. If the client asks for completions in any context where we aren't inside a node (i.e. we're just in the 'Program' node), we should basically send all composite completions, instead of no completions.
I give this PR an A for correct behaviour and a C- for expressiveness. I really don't love that we're adding another special case to a free function named
is_identifier_like()
. It feels likeis_identifier_like()
is getting at some notion of "should we provide completions?" and this might be the time to articulate the intention more precisely. I suspect this property of the completion site could also become a peer ofparameter_hints_cell
andpipe_root_cell
, i.e. a feature we compute about the completion context early on and then use where needed.I would add a test before I merge this, but am holding off until after further discussion.