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

editor: Do not show inline completion if snippet is active #20300

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mrnugget
Copy link
Member

@mrnugget mrnugget commented Nov 6, 2024

This avoids inline completions being shown (and overriding <tab> behavior) when a snippet is active and the user wants to go through snippet placeholders with <tab>.

Easy to reproduce:

Open a Rust file and use the tfn snippet to produce a test function. Delete the placeholder. Without the change here, the inline provider would suggest a function name. If you <tab>, you accept it, but then you can't <tab> into the function body.

With this change the inline completions are deactivated as long as a snippet is active.

Closes #19484

Release Notes:

  • Fixed inline completions (Copilot, Supermaven, ...) taking over when a snippet completion was active. That resulted in tab not working to jump to the next placeholder in the snippet.

This avoids inline completions being shown (and overriding `<tab>`
behavior) when a snippet is active and the user wants to go through
snippet placeholders with `<tab>`.

Easy to reproduce:

Open a Rust file and use the `tfn` snippet to produce a test function.
Delete the placeholder. Without the change here, the inline provider
would suggest a function name. If you `<tab>`, you accept it, but then
you can't `<tab>` into the function body.

With this change the inline completions are deactivated as long as a
snippet is active.

Closes #19484
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 6, 2024
@kurtbuilds
Copy link
Contributor

I was excited that this got posted to the Quality Week and wanted to offer to pair on fixing it, but you already finished it! 😄

@0x2CA
Copy link
Contributor

0x2CA commented Nov 7, 2024

I'm not sure it makes sense to disable it outright, which would lose the feature forever, in vscode you can use esc to cancel the inline completions and continue to tab to the next placeholder

@mrnugget
Copy link
Member Author

mrnugget commented Nov 7, 2024

I'm not sure it makes sense to disable it outright, which would lose the feature forever, in vscode you can use esc to cancel the inline completions and continue to tab to the next placeholder

What do you think about that @kurtbuilds? I think that makes, except in Vim mode it's kinda not working.

@0x2CA
Copy link
Contributor

0x2CA commented Nov 7, 2024

I'm not sure it makes sense to disable it outright, which would lose the feature forever, in vscode you can use esc to cancel the inline completions and continue to tab to the next placeholder

What do you think about that @kurtbuilds? I think that makes, except in Vim mode it's kinda not working.

In vim it would be cumbersome, and this is the problem I'm having right now, in vscode you need to esc to cancel theinline completions, but it puts vim into normal mode, and you need a to go into insertion mode, and then tab to the next placeholders.

These are not just inline issues, but also conflict auto-completion issues.

The vscode solution is to use enter as a confirmation during autocompletion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inline completions should not run when a LSP Snippet is active
3 participants