Skip to content

Language server uses an ambiguous provider version when multiple .terraform environments exist #1664

Open
@seanhoughton

Description

@seanhoughton

Language Server Version

v0.32.8

Terraform Version

Terraform v1.7.3 on darwin_arm64

Client Version

VSCode 1.87.2

Terraform Configuration

terraform {
  required_providers {
    azuread = {
      source  = "hashicorp/azuread"
      version = "~> 2.47.0"
    }
  }
}

data "azuread_application_published_app_ids" "well_known" {}

Steps to Reproduce

  1. Install multiple versions of a terraform provider
  2. Hover over a resource title
  3. Observe the incorrect version of the provider being used

Alternatively, just hover over the provider to see the incorrect version number
Screenshot 2024-03-18 at 2 26 01 PM
Screenshot 2024-03-18 at 2 27 36 PM

Expected Behavior

The language server should use the version of the provider set in the .terraform.lock.hcl or consider version constraints in the required_providers block.

Actual Behavior

The language server appears to pick a consistent (but sometimes incorrect) version from the ones that are installed.

Gist

No response

Workarounds

Delete all old versions of the provider from the .terraform/providers folder

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions