add language HCL
Terraform doesn't register hcl and doesn't offer good DX if manually set for editing e.g. nomad HCL files.
My first nvf contribution. Maybe somebody could show how to integrate a formatter as well. Other than that it's already an improvement for editing non-Terraform files (e.g. nomad), but it could be probably better. (I vaguely remember the vscode plugin offered some more features).
Looks reasonable. Though, I will need you to format via alejandra and not nixfmt. The formatting check is failing.
Other than that, if there is a known formatter for HCL I can work on getting it added tomorrow. We will need null-ls (or none-ls) to support HCL for proper formatting.
Looks reasonable.
Thanks for looking into it so quickly...
Though, I will need you to format via
alejandraand notnixfmt. The formatting check is failing.
Ah yes, different than nixpkgs :sweat_smile:
While we're at it, is there a trick that I can (e.g. via direnv) use the active HM config for nvf but override certain attributes (like the formatter) in a devshell (when I'm in the nvf repo)? Or would I need to outsource my "standard" nvf config to a separate flake for that?
Looking at none-ls builtins, I see an formatter source for Terraform. This could be used to add formatter support via terraform fmt. Refer to other language modules on how formatter submodules are added - the process is extremely straightforward but I'll be around if you have questions.
While we're at it, is there a trick that I can (e.g. via direnv) use the active HM config for nvf but override certain attributes (like the formatter) in a devshell (when I'm in the nvf repo)? Or would I need to outsource my "standard" nvf config to a separate flake for that?
Afraid there isn't a way to impurely override configuration per-project, but we do provide a formatter that will format the code for you with nix fmt. I will consider making this a pre-commit hook, or at least have pre-commit warn you before you commit the changes.
Looking at none-ls builtins, I see an formatter source for Terraform. This could be used to add formatter support via
terraform fmt. Refer to other language modules on how formatter submodules are added - the process is extremely straightforward but I'll be around if you have questions.
I finally got around to finish this one. In hindsight I might have gone a bit overboard with (unnecessary?) extensibility (inspired by the bash setup), but given the fact that terraform-ls is a bit too generic for nomad, there may be more specific solutions in the future that we might then easily integrate.
EDIT: spelling (noticed spelling "funture", I might be on to something :rofl )
Sorry for the delay in my review, I'm very busy with IRL stuff at the moment.
We're currently at the final stretch for merging the next big release (see #355) and I've frozen the main branch to avoid merge conflicts. If you could rebase this around the v0.7 branch, I should be able to provide a final review or/and merge this PR tomorrow.
Thanks
If you could rebase this around the
v0.7branch, I should be able to provide a final review or/and merge this PR tomorrow.
Done (just pushed ther rebased one)
Ah, the good old rebase vs merge mess :wink: Should be ok now...
All good, merging once CI passes.