-
Notifications
You must be signed in to change notification settings - Fork 137
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
prefilledRequiredFields not working with neovim and nvim-lspconfig #1676
Comments
The experimental options belong in a different object which is passed at init time, like this...
|
Hi @zombiRon , Still no luck: return {
'neovim/nvim-lspconfig',
opts = {
inlay_hints = { enabled = true },
},
config = function()
-- Set up Terraform LSP
require('lspconfig').terraformls.setup({
filetypes = { 'terraform', 'hcl' },
settings = {
validateOnSave = true,
},
init_options = {
experimentalFeatures = {
prefillRequiredFields = true,
},
},
})
end,
} |
I wouldn't recommend the validateonsave option, but if you do want it, it's experimental so goes alongside prefillrequiredfields. According to the docs the settings list isn't used so needs removing. Is the lang server even connected? |
Now it looks like this: require('lspconfig').terraformls.setup({
filetypes = { 'terraform', 'hcl' },
init_options = {
experimentalFeatures = {
prefillRequiredFields = true,
},
},
}) However, no luck still: The lang server is connected. Here is the output of Screenshot: |
Hi @esn89, you don't need to specify Thank you for sharing the |
Absolutely. I have removed the
|
Can you please share the full log? I'm looking for the |
Just a thought, are normal completions working? |
@zombiRon the normal completions are a bit janky. I can see completion like this: https://imgur.com/a/bb005H2 |
Here are the logs again:
Here's the first 200 lines. I am having troubles with gist/pastebin. Let me know if you need more. |
Thanks for confirming. What does the minimal config that I should try look like? One more thing, does the folder structure matter? And also, do I need to run |
A single terraform {
required_providers {
google = {
source = "hashicorp/google"
}
}
}
<resource completion here> We bundle all official and partner provider schemas with the language server, so it should work without running |
Alright, let me try it on a single main.tf in a brand new Update:
|
Another I noticed is that with my minimal config that you gave me, when I start typing:
|
Was wondering if there are any updates on this? :) |
If you don't get any resource completion results, it may be that we don't have the provider schema. Can you please post the output of |
Hi @dbanck , thanks for your repl. Here are the stats:
main.tf: terraform {
required_providers {
google = {
source = "hashicorp/google"
}
}
}
provider "google" {
}
resource "goog" // <--- autocomplete never happened here. logs of :LspLog (~/.local/state/nvim/lsp.log)
|
I think you might be hitting #57. If you use completion for the |
Marking this issue as stale due to inactivity over the last 30 days. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. Thank you for understanding. |
Closing this issue due to its staleness. If the issue was automatically closed and you feel it should be reopened, we encourage creating a new one linking back to this one for added context. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Language Server Version
v0.32.8
Terraform Version
Terraform v1.7.5 on darwin_arm64
Client Version
NVIM v0.9.5 with nvim-lspconfig
Terraform Configuration
Expected Behavior
I expect to see the prefilledRequiredFields starting to show up similar to:
https://user-images.githubusercontent.com/287584/136541482-2ab68fa1-c3bd-41f8-83c6-3fbd3e9f942d.gif
Actual Behavior
Nothing, I just get nothing happening. It just looks like where I left off without the required fields populating.
Gist
No response
Workarounds
No response
References
hashicorp/vscode-terraform#799
https://github.com/hashicorp/vscode-terraform/?tab=readme-ov-file#code-completion
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: