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

Let ppat_any trigger completion in patterns #692

Merged
merged 3 commits into from
Jan 12, 2023
Merged

Conversation

zth
Copy link
Collaborator

@zth zth commented Jan 11, 2023

This makes it so that triggering completion on _ (Ppat_any) is considered the same as triggering an empty typed completion. Some(<com>) and Some(_<com>) is now considered the same when triggering completion.

The main reason is that we're inserting _ and putting the cursor on it via snippets. So, being able to trigger completion directly again on _ is quite helpful.

@zth zth requested a review from cristianoc January 11, 2023 18:52
@zth zth mentioned this pull request Jan 11, 2023
24 tasks
@@ -695,6 +695,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
match orPatWithItem with
| None when isPatternHole p1 || isPatternHole p2 -> Some ("", patternPath)
| v -> v)
| Ppat_any -> someIfHasCursor ("", patternPath)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add a quick comment.

@zth zth merged commit 37cd3db into master Jan 12, 2023
@zth zth deleted the let-ppat-any-complete branch January 12, 2023 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants