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

Can't accept inline suggestions #1001

Open
jonkyops opened this issue Oct 26, 2023 · 8 comments
Open

Can't accept inline suggestions #1001

jonkyops opened this issue Oct 26, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@jonkyops
Copy link

Summary

TLDR: When I set "ansible.lightspeed.enabled": false and hit tab to accept an inline suggestion in an ansible file, VSCode gives a warning in the bottom right: command 'ansible.lightspeed.inlineSuggest.accept' not found instead of accepting the suggestion.

Looks like it might be caused by the extension's keybindings settings not checking if lightspeed is enabled for tab and escape:
https://github.com/ansible/vscode-ansible/blob/main/package.json#L493-L515

Extension version

2.8.108

VS Code version

1.79.2

Ansible Version

ansible [core 2.15.4]
  config file = None
  configured module search path = ['/home/{wsl user}/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /mnt/c/Users/{win user}/dev/keycloak/ansible/.venv/lib/python3.11/site-packages/ansible
  ansible collection location = /home/{wsl user}/.ansible/collections:/usr/share/ansible/collections
  executable location = /mnt/c/Users/{win user}/dev/keycloak/ansible/.venv/bin/ansible
  python version = 3.11.4 (main, Jun  6 2023, 22:16:46) [GCC 11.3.0] (/mnt/c/Users/{win user}/dev/keycloak/ansible/.venv/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True

OS / Environment

Windows 10, WSL (Ubuntu 22.04.3 LTS), ansible-lint 6.20.3

Relevant log output

No response

@jonkyops jonkyops added bug Something isn't working new labels Oct 26, 2023
@shaneholloman
Copy link

same issue also on a bare metal Ubuntu 22.04 installation

@LarsParTec
Copy link

same issue on macOS

@jeefberkey
Copy link

I'm unable to use github copilot, or any tab completions when edting ansible files

@hackatoo
Copy link

@shaneholloman @LarsParTec @jeefberkey
Got same error while installing Bito Autocomplete.
I diasabled and enabled Ansible Lightspeed again at @ext:redhat.ansible and then restarted the Visual Studio.
Now everything seems work fine.

@LarsParTec
Copy link

@hackatoo Great. Simply disabling/enabling the redhat.ansible extension resolves the issue. Thanks.

@zhiyuan-lin
Copy link

I got the exact same issue in the specified environment, please provide user an option to disable lightspeed completely.

@jonkyops
Copy link
Author

Adding this to my my keybindings.json fixed it for me (Command Palette > Preferences: Open Keyboard Shortcuts (JSON)):

    {
        "key": "tab",
        "command": "-ansible.lightspeed.inlineSuggest.accept",
        "when": "inlineSuggestionVisible && editorLangId == 'ansible'"
    },
    {
        "key": "escape",
        "command": "-ansible.lightspeed.inlineSuggest.hide",
        "when": "inlineSuggestionVisible && editorLangId == 'ansible'"
    },

@MallocArray
Copy link

MallocArray commented Feb 12, 2024

I finally figured this out! I couldn't use CoPilot suggestions due to the same error when pressing Tab.

I fully uninstalled the Ansible extension, restarted VSCode, confirmed CoPilot Tab complete worked, then reinstalled the Ansible extension and it broke again.

Finally, I found that in the Gear icon in VSCode, there is a "Keyboard Shortcuts" option (Ctrl+K Ctrl+S)
In here I found the entry that was throwing the error "ansible.lightspeed.inlineSuggest.accept" and it was bound to Tab, just like the auto-complete was.
Rather than mess around with any When statements, I just right clicked and "Remove Keybinding" and now I can use Tab to complete CoPilot suggestions.

Since I never had Lightspeed enabled in the settings, I'm surprised this binding was set at all, but with it completely conflicting with a more helpful option, I won't miss it.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

10 participants