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

Improve completions #410

Merged
merged 11 commits into from
Oct 16, 2023
Merged

Improve completions #410

merged 11 commits into from
Oct 16, 2023

Conversation

zachallaun
Copy link
Collaborator

@zachallaun zachallaun commented Oct 12, 2023

Depends on #409, which was cherry-picked out of this branch initially to make review easier.

This PR includes a set of fixes and improvements for completions. It's probably best to review commits individually.

Please do pull and build this branch and play with completions locally.


Related:

@zachallaun zachallaun force-pushed the za-completions-improvements branch 2 times, most recently from 729f362 to d8537ef Compare October 12, 2023 18:11
@zachallaun zachallaun force-pushed the za-completions-improvements branch from d8537ef to 0d75016 Compare October 13, 2023 14:19
Copy link
Collaborator

@scohen scohen left a comment

Choose a reason for hiding this comment

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

The only thing i'm not a fan of in this PR is enabling erlang modules for single character completions. It's a LOT of noise.

@zachallaun zachallaun force-pushed the za-completions-improvements branch 2 times, most recently from e0e9dd8 to 078e645 Compare October 13, 2023 18:43
@zachallaun zachallaun requested a review from scohen October 13, 2023 19:55
@zachallaun zachallaun mentioned this pull request Oct 14, 2023
2 tasks
@zachallaun zachallaun force-pushed the za-completions-improvements branch 2 times, most recently from d3cf414 to 572ce9c Compare October 15, 2023 18:08
@zachallaun zachallaun force-pushed the za-completions-improvements branch from 572ce9c to 46a62a5 Compare October 16, 2023 13:33
zachallaun and others added 11 commits October 16, 2023 09:33
- Removes unnecessary `$0` from end of some snippets, as it introduces
  trailing whitespace
- Use more consistent capitalization for labels
- Improved snippets for `defdelegate`, `defguard`, `defguardp`, `with`,
  `quote`
Related: #400

VS Code in particular handles empty completions lists very poorly,
refusing to make further completion requests. This commit removes the
logic that was preventing completions from being returned when the
prefix is a single character.
Prior to these changes, do/end blocks would be suggested in situations
like `@do|`.
This commit reverts some of #398 in order to retain the previous, better
UX that users had in other editors, while still allowing completions to
work in VS Code.
…`{ isIncomplete: false, items }`.

According to this explanation:

> result: CompletionItem[] | CompletionList | null. If a CompletionItem[] is provided, it is interpreted as complete. So it is the same as { isIncomplete: false, items }.

I suspect that many clients do not handle the situation of `{ isIncomplete: false, items }`.
They default to only handling `CompletionItem[]`.
@zachallaun zachallaun force-pushed the za-completions-improvements branch from 46a62a5 to e2feb49 Compare October 16, 2023 13:34
@scohen
Copy link
Collaborator

scohen commented Oct 16, 2023

@zachallaun this looks ready to me. Things seem to work well in emacs.

@zachallaun zachallaun merged commit b01a862 into main Oct 16, 2023
6 checks passed
@zachallaun zachallaun deleted the za-completions-improvements branch October 16, 2023 17:48
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.

3 participants