Autocompletion removes a line instead of completing it
See original GitHub issueSanity check
- I certify that the
redhat.ansible
extension is in use and the language of the document in this bug report shows up asAnsible
Summary
When I press enter, tab or select autocompletion line with left mouse button, the line I was currently typing disappears.
Extension version
0.8.1
VS Code version
1.66.2
Ansible Version
└─$ ansible --version 127 ⨯
ansible [core 2.12.2]
config file = /Users/maciej/.ansible/ansible.cfg
configured module search path = ['/Users/maciej/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /opt/homebrew/Cellar/ansible/5.3.0/libexec/lib/python3.10/site-packages/ansible
ansible collection location = /Users/maciej/.ansible/collections:/usr/share/ansible/collections
executable location = /opt/homebrew/bin/ansible
python version = 3.10.2 (main, Feb 2 2022, 05:51:25) [Clang 13.0.0 (clang-1300.0.29.3)]
jinja version = 3.0.3
libyaml = True
OS / Environment
└─$ sw_vers ProductName: macOS ProductVersion: 12.3.1 BuildVersion: 21E258
└─$ ansible-lint --version WARNING: PATH altered to include /opt/homebrew/Cellar/ansible-lint/6.0.2/libexec/bin ansible-lint 6.0.2 using ansible 2.12.3
Relevant log output
None available. Please let me know if there are any logs I should be providing at this stage.
Issue Analytics
- State:
- Created a year ago
- Comments:9
Top Results From Across the Web
Visual Studio IntelliCode Whole line completions
When the user is typing, we show whole line completions which can be accepted by "Tab to accept". To dismiss the prediction, you...
Read more >Tab autocomplete in Visual Studio Code doesn't work
Open Visual Study Code Setting. Enable Tab Completion.
Read more >nvim-cmp deletes the first word after autocomplete. - Reddit
This only happens when the completion comes from the LSP. Completions from buffer text do not replace the word after the autocompleted one....
Read more >Select an item in vim autocomplete list without inserting line ...
I understand from your question that you're in state 2 (since you've pressed arrow keys to find a completion). However, the default behavior...
Read more >How to use Cmd's tab autocomplete effectively? - Super User
The way Bash's autocomplete works is that the tab key expands only if there is a unique expansion. Otherwise, nothing happens, but you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
What you said is absolutely right it seems. For some combination of versions, vscode API for autocompletion that involves
insertText
does not work. To support all of this,textEdit
is also supposed to be used, which we missed. There’s a PR for this as well: https://github.com/ansible/ansible-language-server/pull/330/Feel free to open this issue or a new one if you face a similar sort of problem with some other version combinations even after the following PR is merged and released!
Hi, just an update. I am working today from the same machine, not sure what has changed but this bug has gone away. Now, upon pressing enter, the line autocompletes and cursor moves to the next line indented (as expected).
VSC:
Ansible: v0.9.0 preview
Ansible & ansible-lint:
It seems the only notable difference between my last post when the bug was occurring and today is that I must’ve updated ansible core package along the way.
Is there anything I can do to help your team narrow it down? Although I now suspect the issue must be quite unique combination of versions of various elements, that seem to be incompatible??