-
Notifications
You must be signed in to change notification settings - Fork 179
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
meta: Support for Terraform files other than .tf #636
Comments
Any updates... seems like quite an easy win and import to have. Looking at my |
It seems the extension is not supporting |
I think there may be differences in opinions on what "support" really means. As you pointed out, the language server does parse JSON files to provide to provide e.g. completion of references to configuration inside those JSON files. It does not however provide any code intelligence (completion, hover etc.) inside those JSON files. As it turns out this level of support is not ideal - @dbanck points out some downsides in hashicorp/terraform-ls#705 - so it's clear we'll have to make some changes in this area. That said I am still not sure that providing completion/hover etc. inside JSON files is what we really should be offering as the JSON format is primarily for machines to read, not humans, so I wouldn't expect humans to be hand-editing JSON files. TL;DR @freeman Can you clarify what "not supporting" means to you? |
@radeksimko In my project I have I do not expect language server support in the JSON files (as in fact they are generated by scripts). |
@freeman That sounds like a bug - we should already support such a scenario, would you mind creating a separate bug report and attaching some more details, ideally with pieces of configuration, so we can reproduce and look into it, and hopefully get it fixed? 🙏🏻 |
The current docs imply that using https://developer.hashicorp.com/terraform/language/settings/backends/configuration#file |
Depends on #638
Problem Statement
Terraform supports a number of different files for different purposes (aside from
*.tf
for infrastructure configuration):*.tfvars
/*.tfvars.json
)*.tftest
/*.tftest.json
) - https://github.com/hashicorp/terraform/pull/33454/files#diff-c0da14d97b20324424a945e29250f498d2338bf97f8b19f159d39445c877c82aR15.terraformrc
/.terraform.rc
/*.tfrc
)templatefile
function (*.tftpl
)terraform init -backend-config=HERE
(*.<BACKEND-NAME>.tfbackend
)The VS Code extension currently does not provide any support for the above files.
User Impact
Any users which use any of the above files would benefit from support.
It is likely that
*.tfvars
would have the highest impact of all - i.e. used by more users than the other files, but there is currently no data to back it up. It would make sense to just support all of the above formats.Expected User Experience
Users will be provided with the same experience as for
*.tf
files today.Proposal
terraform-ls
, each with relevantLanguageID
terraform-ls
provides support for the relevant LanguageIDs:*.tfvars
: Support variable files (*.tfvars
) terraform-ls#50*.tfvars.json
: Support JSON variable files (*.tfvars.json
) terraform-ls#519.terraformrc
/.terraform.rc
/*.tfrc
: Support Terraform CLI config files (terraform.rc
) terraform-ls#497*.tftpl
: Support for template files (*.tftpl
) terraform-ls#521*.<backend-name>.tfbackend
: Support backend config files (forinit -backend-config=PATH
) terraform-ls#518The text was updated successfully, but these errors were encountered: