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

Allow using "#" for line comments #313

Closed
khaliddermoumi opened this issue Aug 20, 2024 · 4 comments
Closed

Allow using "#" for line comments #313

khaliddermoumi opened this issue Aug 20, 2024 · 4 comments

Comments

@khaliddermoumi
Copy link

Please support using "#" as the line comment character.

So far, the extension uses only "//", and there seems to be no way to configure this.
As "#" is the typical line comment character in Terraform, when using this extension with TF, it would be very desirable to have "#" in the hcl files too.

@jpogran
Copy link
Contributor

jpogran commented Sep 11, 2024

Hi @khaliddermoumi, this extension is not meant to be used for Terraform (.tf) files, as described in the README. This extension uses the official HCL library rules as defined here: hclsyntax/spec.md which state no preference for which to use. There is no way to configure this, because VS Code itself does not provide a way for a user to do this.

The official HashiCorp Terraform Extension uses # as the line comment symbol. We strongly recommend you use vscode-terraform to edit Terraform files. May I ask why you are using the HCL extension for Terraform files?

@khaliddermoumi
Copy link
Author

khaliddermoumi commented Sep 11, 2024

Hi @jpogran!

I am using the extension to edit terragrunt files (.hcl), which are authored in terraform syntax. You can't use the dedicated TF extension for this, as it would validate the terragrunt specific parts as "errors". vscode-hcl is the better choice, but it should use the "#" comment symbol for TF code (just like the TF extension).

I am sure this is a common issue, as terragrunt is widely used by TF users.

@suburbanworrier
Copy link

suburbanworrier commented Sep 26, 2024

Hi

I recently burnt way too much time trying to sort out what extensions are required for my new laptop to work on a Terragrunt project. I thought I'd got it sorted when I installed this one but the double slash comments are driving me insane as all of the code I'm working with is chock full of # comments.

@jpogran says:

the official HCL library rules ... state no preference for which to use

and

The official HashiCorp Terraform Extension uses #

so who decided this one must use //?

Please, please make it configurable or just change to the more widely used #.

@dbanck
Copy link
Member

dbanck commented Oct 23, 2024

After some consideration and the discussion in this issue, we've decided to make # the default character for line comments.

This change will be part of the upcoming 0.6.0 release.

@dbanck dbanck closed this as completed Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants