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

Link to module docs for uninitialized remote (Terraform Registry) modules #892

Closed
2 tasks done
radeksimko opened this issue Apr 25, 2022 · 2 comments
Closed
2 tasks done
Labels
enhancement New feature or request modules Functionality related to the module block and modules generally textDocument/documentLink
Milestone

Comments

@radeksimko
Copy link
Member

radeksimko commented Apr 25, 2022

This is an extension of hashicorp/vscode-terraform#673


Background

#874 / hashicorp/terraform-schema#103 is adding links to module docs for modules hosted in the Registry. #599 already tracks other functionality like completion or hover for uninitialized Registry modules.

Similar to #725 users would likely expect the source to be linkable as they type, without having to install the module via terraform init or terraform get.

Proposal

@radeksimko radeksimko added enhancement New feature or request textDocument/documentLink modules Functionality related to the module block and modules generally labels Apr 25, 2022
@radeksimko radeksimko added this to the v0.29.0 milestone Jul 8, 2022
@radeksimko
Copy link
Member Author

This was implemented as part of hashicorp/terraform-schema#113 / #924

Currently the way it works is that we pull the module metadata from the Terraform Registry API on the background and - if successful - as a result of finding the relevant metadata successfully (which is really mainly used for completion/hover of inputs and outputs), we also end up attaching the docs link. So only end up linking to modules which actually exist on the Registry - practically eliminating the chance of pointing users to 404s.

We could theoretically attach the link to anything that is syntactically valid Registry source address - e.g. foo/bar/blah. One benefit is that we'd make links even offline. It's however questionable what use would that be. If we can't reach the Registry on the background, it's also highly likely that the user can't open it in the browser.

Therefore I consider it done.

@github-actions
Copy link

github-actions bot commented Aug 8, 2022

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 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request modules Functionality related to the module block and modules generally textDocument/documentLink
Projects
None yet
Development

No branches or pull requests

1 participant