Skip to content

After updating module to use new version, intellisense for module variables is wrong #1956

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

Open
1 task
green3g opened this issue Mar 7, 2025 · 1 comment
Open
1 task
Labels
bug Something isn't working

Comments

@green3g
Copy link

green3g commented Mar 7, 2025

Language Server Version

0.36.4

Terraform Version

Terraform v1.11.1 on darwin_arm64

Client Version

vscode HashiCorp Terraform 2.34.3 (2025-01-22)

Terraform Configuration

module "api" {
  source  = "gitlab.com/developer/ecs-service/local"
  version = "4.0.0"
  ...variables

Steps to Reproduce

  1. Start with a simple module with an input variable. Publish it as a version to a registry.
  2. Reference it in your project and use the existing variables
  3. Update the module - modify input variables, add or remove some variables. Publish a new version to a registry.
  4. Re-reference the new version in your project and try to use the variables again.
  5. The terraform plugin still references the old version's variables and now gives errors when trying to edit the code.

Expected Behavior

The extension should look at the most recent version installed for the module.

Actual Behavior

The extension uses the old - maybe cached version of the module?

Gist

No response

Workarounds

I haven't found one yet - just wondering if this is an issue others are seeing, or if this workflow works for others.

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@green3g green3g added the bug Something isn't working label Mar 7, 2025
@Evovita
Copy link

Evovita commented May 2, 2025

Workaround

This worked for me - in the HashiCorp Terraform Extension's settings, toggle ON or OFF the Experimental Features Enable validating the currently open file on save option. You should then be prompted to reload the VS Code window - after pressing the Reload button, the errors should disappear.

In my case this setting was turned OFF on account of Issue 1255, so I turned it back ON. It may be the act of toggling the setting clears a cache of some kind.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants