-
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
Unexpected Attribute in tfvars #1838
Comments
Hi @theherk, thanks for the report! Unfortunately I can't reproduce the bug right away. In a single directory with two files, everything seems to work as expected. Can you share the LSP log? |
Sure, given the basic directory with contents: variables.tf variable "cname_records" {
type = map(string)
description = "Map of CNAME records, where key is the domain and value is the record value."
} terraform.tfvars cname_records = {
"_cea53b5cd872a2d2d966a339ae031d59.foo.no." = "_8e50420392efe6ae6720f03fd2acd445.nhqijqilxf.acm-validations.aws."
} The resulting lsp.log is: Details
|
I'm hitting the same issue. Or at least, it manifests with the same "Unexpected attribute" in For reference: ❯ terraform version
Terraform v1.9.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v5.68.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.3.5
+ provider registry.terraform.io/hashicorp/http v3.4.5
+ provider registry.terraform.io/hashicorp/local v2.5.2
+ provider registry.terraform.io/hashicorp/null v3.2.3
+ provider registry.terraform.io/hashicorp/random v3.6.3
+ provider registry.terraform.io/hashicorp/time v0.12.1
+ provider registry.terraform.io/hashicorp/tls v4.0.6 ❯ terraform-ls --version
0.34.3 ❯ nvim --version
NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1725453128 My observation is that if there is a In case it mattered: I deleted my I'm no doubt glossing over the importance of (Someone may be along shortly to tell me I've misconfigured something. And that's fine 🙂 I'm always happy to learn something useful.) |
Here when I open the file it works and after some seconds or when I change the file everything become in error In this log I was opening Regards |
I think I've got this figured out. For myself, at any rate. TL;DR make sure you are not using the filetype.nvim plugin, at least if you are using a recent version of Neovim. I discovered this after hitting a different issue elsewhere, unrelated to Terraform. One thing led to another, and I discovered that the filetype.nvim plugin is no longer needed, due to the functionality being added to Neovim core. So to future travellers: uninstall the |
Hi @quadespresso , thanks. I checked my neovim config and I am not using filetype.nvim and still have this issue ! |
@quadespresso Thanks to your message, I was able to find that the issue disappears for me when I do Most probably, the It's quite ugly, but I was able to workaround the issue by adding this to my vimrc:
|
@Seb-C not sure if this would help you or others: When I run
|
@quadespresso Thanks, that was helpful! The This is now what I have in my Also in my |
Facing the same issue but using pure vim 9.1 and yegappan lsp plugin. Running :LspShowAllServers, it show the following
terraform-ls version
|
Experiencing the same problem with Emacs 29, eglot 1.17 and terraform-ls 0.36.2. |
Language Server Version
0.34.3+Homebrew
Terraform Version
Terraform v1.6.6 on darwin_arm64
Client Version
NVIM v0.10.1
Terraform Configuration
Steps to Reproduce
Expected Behavior
I expect not to get any errors, as this is a correct and working configuration.
Actual Behavior
Receive the error
Unexpected attribute: An attribute named "cname_records" is not expected here
.Gist
No response
Workarounds
No response
References
No response
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: