-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Always return Completion.List
with is_incomplete: true
#398
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zachallaun
force-pushed
the
za-always-incomplete-completions
branch
from
October 10, 2023 14:10
88d101f
to
bc5b082
Compare
The `:is_incomplete` flag signals to the client that completions should be requested on every keypress. If it is not set, the client will generally issue a single completion request when the user starts typing a new "word", and then will filter client-side as subsequent letters are typed. This causes problems for things like `def foo do|` -- VS Code, for instance, issues the request after the `d` of `do` is typed, and does not make another when the `o` is typed. This means you do not see the special-cased completion for a `do/end` block, but instead see a filtered list of completions for everything starting with `d`.
zachallaun
force-pushed
the
za-always-incomplete-completions
branch
from
October 10, 2023 14:56
bc5b082
to
95aa94b
Compare
scohen
approved these changes
Oct 10, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me locally. I didn't notice any difference in emacs.
zachallaun
added a commit
that referenced
this pull request
Oct 14, 2023
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.
zachallaun
added a commit
that referenced
this pull request
Oct 15, 2023
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.
zachallaun
added a commit
that referenced
this pull request
Oct 15, 2023
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.
zachallaun
added a commit
that referenced
this pull request
Oct 16, 2023
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.
zachallaun
added a commit
that referenced
this pull request
Oct 16, 2023
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.
zachallaun
added a commit
that referenced
this pull request
Oct 16, 2023
This commit improves completions for the general case and adds special handling when the client is VS Code that fixes numerous issues related to completions in that editor. General improvements: * Partially revert #398, which introduced a UX regression that caused slow/high latency completions. * Don't insert additional, unnecessary newlines with multi-line snippets. * Improved snippets for `defdelegate`, `defguard`, `defguardp`, `with`. * Consistent capitalization and naming in completion labels. * Fix a bug that caused a do/end block completion to be proposed when the cursor was after `@do`, which would occur whenever typing `@doc`. VS Code: VS Code has some problematic behavior when dealing with empty completion lists. When the client is VS Code, we now attempt to never send empty completion lists if it is possible that further typing will result in some completions. Instead, we send a larger list up front and allow the editor to filter. See #400 for more context. --------- Co-authored-by: Scott Ming <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
:is_incomplete
flag signals to the client that completions should be requested on every keypress. If it is not set, the client will generally issue a single completion request when the user starts typing a new "word", and then will filter client-side as subsequent letters are typed.This causes problems for things like
def foo do|
-- VS Code, for instance, issues the request after thed
ofdo
is typed, and does not make another when theo
is typed. This means you do not see the special-cased completion for ado/end
block, but instead see a filtered list of completions for everything starting withd
.This commit also fixes two minor bugs: a small typo in a logged message, and correctly indenting the cursor after inserting the do/end block.
Before:
After: