-
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
Terraform Language Server doesn't recognize variables defined in other file. #1729
Comments
Hi @crazyoptimist! Thanks for the report. Unfortunately I can't reproduce the bug. Can you please share the full language server log output? Does this bug occur all the time when you open the file? |
It's that simple example. variable "namespace" {
description = "Project naming prefix"
type = string
default = "dev"
} I think above things are better than language server log, and I don't know how I can grab the server log yet. I use terraform-ls.exe on windows, with vim 9.1 and coc.nvim. Thank you! |
An interesting thing is that if I open the variables.tf on a vim's split window, the error goes away. Afterwards, even if I close the variables.tf buffer, the error doesn't appear again. |
Interesting find, thank you. You can write the language server log to a file by passing an additional argument in your coc.vim configuration: https://github.com/hashicorp/terraform-ls/blob/main/docs/TROUBLESHOOTING.md#logging-to-files |
Attached is a minimal log file. I believe you can ignore Thank you for your guidance on logging! |
FYI, I can't reproduce that issue on terraform-ls v0.34.2 and nvim v0.10.1 on GNU/Linux |
Thanks for investigation. It only happens on Windows. The terminal in my screenshot was Alacritty with Git bash. |
Language Server Version
0.33.1
Terraform Version
Terraform v1.8.4 on windows_amd64
Client Version
Vim (coc.nvim) 9.1
Terraform Configuration
Steps to Reproduce
variables.tf
and define a variablenamespace
of string type.terraform init
andterraform apply -auto-approve
Expected Behavior
It should not complain because it's not a bug at all.
Actual Behavior
terraform-ls complains
No declaration found for "var.namespace" (Terraform)
It shows up as an error.
Gist
No response
Workarounds
No workarounds I can find.
References
No response
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: