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

Go to References not working case #585

Closed
Chupaka opened this issue Jul 16, 2021 · 4 comments · Fixed by #587
Closed

Go to References not working case #585

Chupaka opened this issue Jul 16, 2021 · 4 comments · Fixed by #587
Labels
bug Something isn't working

Comments

@Chupaka
Copy link

Chupaka commented Jul 16, 2021

Server Version

terraform-ls 0.19.0

Terraform Version

Terraform v1.0.2
on darwin_amd64
+ provider registry.terraform.io/hashicorp/google v3.75.0

Client Version

VS Code 1.58.2
HashiCorp Terraform v2.13.1

Terraform Configuration Files

variable "test2" {
  default = "mynameis"
}

resource "google_compute_instance" "checking" {
  name = var.test2
  machine_type = "fake"
  network_interface {}
  boot_disk {
    initialize_params {
      image = "img"
    }
  }
}

Log Output

2021/07/16 14:36:50 server.go:591: Received 1 new requests
2021/07/16 14:36:50 server.go:175: Processing 1 requests
2021/07/16 14:36:50 server.go:266: Checking request for "textDocument/references": {"textDocument":{"uri":"file:///Users/pavel.skuratovich/tmp/go-to-reference/file1.tf"},"position":{"line":1,"character":22},"context":{"includeDeclaration":true}}
2021/07/16 14:36:50 rpc_logger.go:29: Incoming request for "textDocument/references" (ID 452): {"textDocument":{"uri":"file:///Users/pavel.skuratovich/tmp/go-to-reference/file1.tf"},"position":{"line":1,"character":22},"context":{"includeDeclaration":true}}
2021/07/16 14:36:50 provider_schema.go:196: PSS: getting provider schema (/Users/pavel.skuratovich/tmp/go-to-reference, registry.terraform.io/-/google, )
2021/07/16 14:36:50 references.go:60: finding origins for inner-most target: &lang.ReferenceTarget{Addr:lang.Address{lang.RootStep{Name:"var"}, lang.AttrStep{Name:"test2"}}, ScopeId:"variable", RangePtr:(*hcl.Range)(0xc009870500), Type:cty.String, Name:"", Description:lang.MarkupContent{Value:"", Kind:0x0}, NestedTargets:lang.ReferenceTargets(nil)}
2021/07/16 14:36:50 rpc_logger.go:50: Response to "textDocument/references" (ID 452): []
2021/07/16 14:36:50 server.go:247: Completed 1 requests [3.362738ms elapsed]

Steps to Reproduce

Click line 1-3 and select "Go to References"

Expected Behavior

Jump to line 6 (name = var.test2)

Actual Behavior

No references found for 'test2'

@radeksimko radeksimko added the bug Something isn't working label Jul 16, 2021
@radeksimko
Copy link
Member

Reproduced, thank you for the detailed report.

I will look for the root cause and fix.

@radeksimko
Copy link
Member

This was fixed as part of #587 which is part of the release 0.19.1 I just published.

Can you try updating to that version and confirm the problem is resolved? VS Code should prompt the upgrade automatically upon launch or within the next 24 hours.

@Chupaka
Copy link
Author

Chupaka commented Jul 23, 2021

Thanks, I confirm that this case was fixed, but I'm filing another one right now :)

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants