You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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.
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
The text was updated successfully, but these errors were encountered: