Skip to content

LSP not detecting the root providers in modulesΒ #2039

@franciscojf

Description

@franciscojf

Language Server Version

v0.38.1

Terraform Version

Terraform v1.5.7 on darwin_arm64

Client Version

NVIM v0.11.4 with nvim-lspconfig (LazyVim -> LazyExtras -> Terraform)

Terraform Configuration

https://www.dropbox.com/scl/fi/z0m6qf4kx8cvtar3tbknj/terraform-test.zip?rlkey=jwmhguoj19ln8jvdi47ojn6lh&st=hbhpg9ms&dl=0

Steps to Reproduce

  1. Unzip the folder
  2. Run terraform init on terraform-test/infrastructure/customers/customer-a/
  3. Run terraform validate on terraform-test/infrastructure/customers/customer-a/
  4. In neovim open the file terraform-test/infrastructure/modules/module-a/main.tf
  5. If trouble.nvim is installed <Leader>xx to show the detailed error.

Expected Behavior

There should be no errors showing.

Actual Behavior

Error shown on trouble.nvim plugin: Missing required provider - This configuration requires provider registry.terraform.io/hashicorp/azurerm, but that provider isn't available. You may be able to install it automatically by running:
β”‚ β”‚ terraform init

Gist

No response

Workarounds

No response

References

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