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

Ansiblels Does Not Provide Completions #391

Closed
PriceHiller opened this issue Jun 30, 2022 · 3 comments · Fixed by #405
Closed

Ansiblels Does Not Provide Completions #391

PriceHiller opened this issue Jun 30, 2022 · 3 comments · Fixed by #405
Assignees
Labels
bug Something isn't working new Use track issue requiring triage

Comments

@PriceHiller
Copy link

PriceHiller commented Jun 30, 2022

Summary

When using the latest version of Ansiblels I no longer get completions. After tracking it down, I no longer get completions after this commit: c695ba2. Using the commit just prior (9211f4a), I am getting completions.

A gif of this in action:
ansible-ls-failure

Extension version

N/A

VS Code version

N/A

Ansible Version

ansible [core 2.13.1]
  config file = None
  configured module search path = ['/Users/pricehiller/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/pricehiller/.pyenv/versions/3.10.2/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/pricehiller/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/pricehiller/.pyenv/versions/3.10.2/bin/ansible
  python version = 3.10.2 (main, Feb 15 2022, 21:01:48) [Clang 13.0.0 (clang-1300.0.29.30)]
  jinja version = 3.1.2
  libyaml = True

OS / Environment

macOS Monterey 12.4, ansible-lint 6.3.0, ansible 2.13.1

Relevant log output

From Neovim's LSP log on the failing completion:

[ERROR][2022-06-30 16:13:37] ...lsp/handlers.lua:473	"An error occurred in 'onCompletion' handler: [TypeError] Cannot read properties of undefined (reading 'provideRedirectModules')\nTypeError: Cannot read properties of undefined (reading 'provideRedirectModules')\n    at /Users/pricehiller/.local/share/nvim/lsp_servers/ansiblels/out/server/src/providers/completionProvider.js:45:112\n    at Generator.next (<anonymous>)\n    at fulfilled (/Users/pricehiller/.local/share/nvim/lsp_servers/ansiblels/out/server/src/providers/completionProvider.js:5:58)"
@PriceHiller PriceHiller added bug Something isn't working new Use track issue requiring triage labels Jun 30, 2022
@PriceHiller
Copy link
Author

PriceHiller commented Jun 30, 2022

Seems to be only related to ansible.completion.provideRedirectModules, when I disable that in my configuration for the lsp I get completions.

@yaegassy
Copy link
Contributor

@treatybreaker Hi,

I am using ansible-language-server with another plugin for Vim/Neovim and it works fine.

Are there any problems with language server settings, etc.? Try adding ansible.completion.provideRedirectModules and ansible.completion.provideModuleOptionAliases settings based on this document. https://als.readthedocs.io/en/latest/settings/

If nvim-lspconfig is used, the target configuration does not appear to exist by default. https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/ansiblels.lua

@yaegassy
Copy link
Contributor

If the language server side is to be adjusted, I feel it would be a good idea to add handling for cases where settings are not passed from the LSP client.

I don't know how to read Neovim's LSP log correctly, but it seems to be undefined, so.

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

Successfully merging a pull request may close this issue.

3 participants