-
Notifications
You must be signed in to change notification settings - Fork 131
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
Pre-fill required local module inputs on source completion #1040
Comments
@dbanck apologies for the hijack as I didn't want to open a new issue and can't comment on #1024 Would #1024 work for neovim folks? I'm having a hard time finding a way to trigger the autocomplete like in your gif. My |
Hi @nocode99, Module source and version completion should work for all editors. However, you might see different results depending on your Terraform LS installation source. This is because the binaries we build and publish on releases.hashicorp.com contain the static schema for the top registry providers and Algolia tokens, which power the module search. Both aren't included if you compile the language server or install it via the default Homebrew formula. You can check which version you use via the Installation via Homebrew community reports
Installation via HashiCorp Homebrew Tab or releases.hashicorp.com or Linux packaging reports
When using the latter, module source and version completion should work. Autocompleting the source to a local module should work for all language server versions. |
Thanks for the reply @dbanck. I'm running on Ubuntu. I'll be sure to review my settings and see what I need to do to get this to work. |
Following on nocode99's issue -- I'm also unable to complete remote module sources. I've verified I have 0.34.2 from upstream (md5sum db742e18bf7a32f71960dfc12abbbd1d) Version completion works fine, which is interesting! (local version also completes, but that's not as interesting since it doesn't require the algolia key) |
Hi @travisby, can you please open a separate bug if this is still happening for you. |
Background
In #1024, we introduced completion for local module sources. It uses the local indexed modules to build a list of source strings relative to the current file. The indexed modules also contain a list of module inputs (and outputs). So we can use those inputs to build a text snippet containing only the required ones.
Contrary to the registry module sources we can accomplish this without a resolve handler for completion items, since it doesn't involve any HTTP requests. All the data we need is already present.
Expected User Experience
Fill the required module inputs when completing a local module source, providing a similar experience as for resources:
This includes:
editor.suggest.preview
enabledProposal
hashicorp/terraform-ls
CompleteLocalModuleSources
hookmod.Meta.Variables
textEdit
for each candidate with a snippet based on the inputstextEdit
still is a single line, while the snippet may contain multiple newlines.Additional context / links
The text was updated successfully, but these errors were encountered: