Skip to content
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

Module output completion broken if 2+ modules have the same source #1107

Open
radeksimko opened this issue Nov 3, 2022 · 1 comment
Open
Labels
bug Something isn't working modules Functionality related to the module block and modules generally technical-debt textDocument/completion

Comments

@radeksimko
Copy link
Member

Server Version

0.29.3

Client Version

2.24.3-darwin-arm64

Terraform Configuration Files

module "alpha" {
  source = "./submod"
}

module "beta" {
  source = "./submod"
}

output "name" {
  value = module. # completion HERE
}

Expected Behavior

Screenshot 2022-11-03 at 13 23 04

Actual Behavior

Screenshot 2022-11-03 at 13 26 22

Additional Context

There's a naive simple fix in https://github.com/hashicorp/terraform-schema/pull/158/files but that may have some other side effects in other contexts.

It's also related to #895

@radeksimko radeksimko added bug Something isn't working textDocument/completion labels Nov 3, 2022
@radeksimko radeksimko changed the title Module Output completion broken if 2+ modules have the same source Module output completion broken if 2+ modules have the same source Nov 3, 2022
@xiehan xiehan added the modules Functionality related to the module block and modules generally label Apr 21, 2023
@bgshacklett
Copy link

bgshacklett commented Jul 24, 2023

note: my editor is NeoVim, using the built-in language server host
This seems to go deeper than just completing the module name. If we take this a step further:

module "alpha" {
  source = "./modules/example"
}

module "beta" {
  source = "./modules/example"
}

output "name" {
  value = module.alpha. # completion here
}

I'm finding that I often don't get any completion attempts in the above location:
image

If I keep trying enough times, though, I might get something eventually:
image

I also see my references remain unresolved in a number of locations, leading to uncertainty around whether I've got the right identifiers in place or not:
image

@radeksimko Could you give us a bit more insight into what's going on in your example PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working modules Functionality related to the module block and modules generally technical-debt textDocument/completion
Projects
None yet
Development

No branches or pull requests

3 participants