Replies: 1 comment
-
|
Hi! Thank you for your question. There’s a similar issue where IntelliJ uses its built-in formatter instead of the formatter from the OpenTofu binary. For the future, even if it’s just a question, it’s better to create an issue in YouTrack so we can track it properly |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, ultimate user here.
In IntelliJ, it is in principle possible to use Terraform or OpenTofu to format .tf files (as opposed to the built-in formatter).
You'd expect this to work out of the box provided you've set the executable paths under Settings > Tools > Terraform Tools.
Personally, I only have OpenTofu in my machine, have the executable's path set, and would expect IntelliJ to fall back to it when Terraform is unavailable. However, when reformatting code, I get the following error:
How can I get this to work reliably?
There's this funny trick where you can set the path to OpenTofu under the
Terraform executable path:field (yes, that way around), and then the code formatter will work. But this will randomly unset. (Side remark: I wonder how this trick can work; can you just put the path to any binary with the necessary commands and have IntelliJ run the binary'sfmtcommand to do wild things?)Beta Was this translation helpful? Give feedback.
All reactions