Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Smart autocompletion don't work #30

Open
dssdss opened this issue Oct 12, 2021 · 7 comments
Open

Smart autocompletion don't work #30

dssdss opened this issue Oct 12, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@dssdss
Copy link

dssdss commented Oct 12, 2021

Summary

Smart autocompletion don't work, I've recorded a short video to illustrate it.

Video_2021-10-12_114631

Extension version

1.0.8

VS Code version

1.61.0

Ansible Version

$ ansible --version
ansible [core 2.11.5] 
  config file = /home/dss/ansiblewin/ansible.cfg
  configured module search path = ['/home/dss/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/dist-packages/ansible
  ansible collection location = /home/dss/.ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
  jinja version = 3.0.1
  libyaml = True

OS / Environment

vscode Version: 1.61.0 (user setup)
Commit: ee8c7def80afc00dd6e593ef12f37756d8f504ea
Date: 2021-10-07T18:13:09.652Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

I tried to use this plugin with Remote - SSH
Plugins installed local:
image
image

Plugins installed on remote:
image

Remote system:
Debian 11

/usr/bin/python3 --version
Python 3.9.2

pip3 list
Package Version
ansible 4.6.0
ansible-core 2.11.5
ansible-lint 5.2.0
bcrypt 3.2.0
bracex 2.1.1
certifi 2020.6.20
cffi 1.14.6
chardet 4.0.0
colorama 0.4.4
commonmark 0.9.1
cryptography 3.3.2
dbus-python 1.2.16
distro-info 1.0
enrich 1.2.6
httplib2 0.18.1
idna 2.10
Jinja2 3.0.1
jmespath 0.10.0
MarkupSafe 2.0.1
packaging 21.0
paramiko 2.7.2
pip 21.2.4
pycparser 2.20
pycurl 7.43.0.6
Pygments 2.10.0
PyGObject 3.38.0
PyNaCl 1.4.0
pyparsing 2.4.7
PySimpleSOAP 1.16.2
python-apt 2.2.1
python-debian 0.1.39
python-debianbts 3.1.0
pyvmomi 7.0.2
PyYAML 5.4.1
reportbug 7.10.3+deb11u1
requests 2.25.1
resolvelib 0.5.4
rich 10.12.0
ruamel.yaml 0.17.16
ruamel.yaml.clib 0.2.6
setuptools 52.0.0
six 1.16.0
tenacity 8.0.1
unattended-upgrades 0.1
urllib3 1.26.5
wcmatch 8.2
wheel 0.34.2

Relevant log output

No response

@dssdss dssdss added the bug Something isn't working label Oct 12, 2021
@dssdss
Copy link
Author

dssdss commented Oct 12, 2021

I've just looked at the similar bugs for Ansible plugin from RedHat and tried some advices from...
So, if I'am forcing triggering suggestions via (ctrl+space) - it works like expected. But it don't work automatically. Is it plugin bug?

@tomaciazek
Copy link
Owner

It is indeed strange. I got used to ctrl+space so I never noticed. I'll investigate it.

@tomaciazek tomaciazek self-assigned this Oct 13, 2021
@tomaciazek
Copy link
Owner

OK, so I've investigated it, and it looks like it is not exactly a bug, it's rather a missing feature. The thing is that VS Code launches autocompletion itself when the word you start typing matches a symbol. This is why you might trigger autocompletion if you start with 'n', because there is a symbol for 'no'. To make other keywords, modules, parameters, etc. trigger autocompletion, they would need to be provided to VS Code as symbols, which is just not implemented yet.

@dssdss
Copy link
Author

dssdss commented Nov 9, 2021

OK, so I've investigated it, and it looks like it is not exactly a bug
Thank you, Tomasz, for researching. Will you create bug (or missing feature) in VS Code tracker?

And I want to say great thanks for this plugin, Tomasz! We waited for his appearance for many years, starting with Ansible 1 =) Its perfect, even with manual autocomplete! Thanks again! =) Old deprecated Microsoft plugin for Ansible was much worse...

@tomaciazek
Copy link
Owner

Thanks Dmitry! The missing feature is not on the VS Code part, but my plugin. Anyway, RedHat folks seem to have found a solution. Try adding this to your configuration JSON:

"[ansible]": {
    "editor.quickSuggestions": {
        "comments": true,
        "other": true,
        "strings": true
    }
}

@dssdss
Copy link
Author

dssdss commented Nov 13, 2021

Now it works, but everywhere.
I think, is better to remove |"comments": true| , because who needed in IntelliSense while typing comments?

And is there any possibility to disable IntelliSense while typing names of the tasks?

- name: And IntelliSense starts to work when I typing this task name...

If it is impossible, this is not so scary... As for me, it became much better... =) Thank you very much!

@tomaciazek
Copy link
Owner

Yes, enabling suggestions on comments is probably unnecessary. As for disabling suggestions while typing names - these are provided by VS Code itself, and extension cannot influence it in that way. As I described above, the perfect solution would be to expose symbols, which would trigger the suggestions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants