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

Please support tfenv #1435

Closed
rbtcollins opened this issue May 17, 2023 · 2 comments
Closed

Please support tfenv #1435

rbtcollins opened this issue May 17, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@rbtcollins
Copy link

Versions

Extension

v2.26.1

Problem Statement

When terraform is only installed via tfenv, Document formatting does nothing and no error is reported. Concretely I did the following:
Opened VS code on a remote Linux connection.
Made a new repository.
Realised I needed terraform, installed tfenv, then used it to install terraform. Exported PATH as documented.
Installed the Terraform VSCode extension.
Found that document formatting wasn't working, looked in random places to get it going.
Found the terraform binary path setting; set that to the path to the downloaded terraform in the tfenv install.
Reloaded the language server. Formatting worked.

Expected User Experience

Formatting of Terraform documents would work. Ideally with the same terraform version selected by tfenv.

Proposal

References

@radeksimko
Copy link
Member

Hi @rbtcollins
It is reasonable to expect formatting to work more "out of the box". We have in the past discussed the possibility of implementing that as part of the extension/LS. I tried to capture some thoughts under hashicorp/terraform-ls#1303 although we do not currently have this on our near-term roadmap.

Strictly speaking, the language server already supports tfenv and other version managers. The only important prerequisite is that the given Terraform version is already installed by the time formatting is attempted and - as a result - terraform version produces predictable output with a version, rather than empty STDOUT with errors in STDERR.

Aside from this use case there some more thoughts on how we could better support tfenv in hashicorp/terraform-ls#305 and hashicorp/terraform-ls#69

With that in mind I'm going to close this issue and keep the conversation in linked ones instead. I hope that's okay with you.

@radeksimko radeksimko closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2023
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

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 Jul 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants