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

Reference count and go to definition #254

Closed
Chupaka opened this issue Aug 5, 2020 · 10 comments · Fixed by #584
Closed

Reference count and go to definition #254

Chupaka opened this issue Aug 5, 2020 · 10 comments · Fixed by #584

Comments

@Chupaka
Copy link

Chupaka commented Aug 5, 2020

In v1.4.0 (TF 0.11) I see reference count for objects and can Cmd+click any interpolation to go to object definition.

Screen Shot 2020-08-04 at 19 36 31

After upgrade to the latest version, I can't see any of it anymore:
Screen Shot 2020-08-05 at 10 48 38

Are there some settings to bring it back?

@radeksimko
Copy link
Member

This isn't supported yet in the latest VSCode extension (v2), but it is another functionality that will be eventually implemented in the language server and - as a result - becomes available in the extension too.

I'm not sure how exactly the extension displayed the number of references in the form of annotations - that is something we might still need to implement on the extension side, but most of the work is actually finding and counting the references, which is something that will be done on the server side. For that reason I'm going to transfer this issue over to the LS repo.

@radeksimko radeksimko transferred this issue from hashicorp/vscode-terraform Aug 5, 2020
@radeksimko
Copy link
Member

Just to set the expectations right though - it's unlikely we will bring back this functionality for 0.11 or any older Terraform versions, or if we do it would be very limited. This is due to the fact that 0.11 requires entirely different parser since it uses HCL1.

@Chupaka
Copy link
Author

Chupaka commented Aug 5, 2020

That's okay, we started the process of migration from 0.11 to 0.12 and are looking for the same UX as we had with 0.11.

@radeksimko radeksimko added the lsp label Aug 10, 2020
@H2so4
Copy link

H2so4 commented Oct 1, 2020

+1 on this feature please

@sata
Copy link

sata commented Nov 28, 2020

Hi maintainers, thanks for this language server implementation. Are there any plans on extending the feature set anytime soon to cover go to definition and find usage similar to the plugin for Intellij?

It would be amazing to have it as a lot more editors would be able to leverage same feature set :)

@radeksimko
Copy link
Member

Hi folks,
the following two features were shipped today in 0.19.0:

I am currently trying to implement the reference count as a code lens and aiming for it to be part of the next release.

Thanks for your patience.

@Chupaka
Copy link
Author

Chupaka commented Jul 8, 2021

@radeksimko Yeah, thanks, checking it right now. However, can't get "Go to References" work. Can it be it works only inside a single file?

E.g. I successfully go to a variable definition in a separate file, but clicking "Go to References" on it says "No references found"

@radeksimko
Copy link
Member

radeksimko commented Jul 8, 2021

@Chupaka Navigating across files (within the same module) should work in both cases. Can you file a new issue for this one and attach the relevant config(s), please?

@radeksimko
Copy link
Member

This was implemented as part of hashicorp/vscode-terraform#686 which was shipped in extension version 2.14.0 and #584 which was shipped in language server version 0.20.0 (yesterday's release).

There are further planned improvements in this area - feel free to subscribe to any of these issues

or open a new one if the problem/feature isn't described in any of them.

@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 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants