-
Notifications
You must be signed in to change notification settings - Fork 135
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
Snippet "tf-azurerm_public_ip" generates outdated resource block. public_ip_address_allocation has beed replaced by allocation_method #1665
Comments
Hi @Jihillestad, The language server does not ship with specific provider snippets. Are you using another neovim plugin for this functionality? |
Looks like it's https://github.com/rafamadriz/friendly-snippets/. The issue it out of this project, sorry about that. The issue should be closed. |
No worries! We also provide an experimental way to pre-populate all the required attributes for a resource: https://github.com/hashicorp/vscode-terraform/?tab=readme-ov-file#code-completion (this links to the VS Code docs, but it works with any editor) Since this is driven by the schema of the provider, it should always be up to date. Might be an alternative to consider instead of the snippets. |
Sounds good! Does it mean that loading it with a LUA file for Lazy.nvim like vscode-terraform.lua will work? return {
"hashicorp/vscode-terraform",
event = { "BufReadPre", "BufNewFile" },
config = true,
}
config = function()
-- How to load the experimental way to pre-populate all the required attributes for a resource?
end, |
No, you only have to add For me, it looks like this: lspconfig.terraformls.setup{
on_attach = on_attach,
capabilities = capabilities,
init_options = {
experimentalFeatures = {
prefillRequiredFields = true,
},
},
} |
It works great. Thanks a lot! |
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.5.7 on darwin_amd64
Client Version
NEOVIM v0.9.5 with neovim/nvim-lspconfig
Terraform Configuration
Steps to Reproduce
Expected Behavior
The snippet result should be something like this if the snippet is prorperly updated.
Actual Behavior
This is the snippet result. public_ip_address_allocation is not supported.
The text was updated successfully, but these errors were encountered: