question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add hcl extension support

See original GitHub issue

Is it possible to add support for .hcl file extension with this plugin? Since terraform code is actually hcl + tfvars files can also be hcl it could make sense, right? I checked the vscode plugin registry and it seems that there is no entry for this kind of files and maybe this one could handle it as it holds all the needed features

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
radeksimkocommented, Apr 9, 2021

Hi folks, Improving editor experience (via highlighting and other features) for “plain” (unknown) HCL or Packer/Nomad/… HCL flavour is something we keep under review. We do not have a solution for this yet though.

The key thing to understand here is that these languages (although based on HCL) differ.

  • This probably shouldn’t matter for simple syntax highlighting grammar, but the grammar we use currently actually is Terraform specific and will be inaccurate for any other HCL languages at this point. One possible course of action we’re considering here is to make a generic HCL grammar which supports (or aims to support) superset of all HCL2 features across known deployments (i.e. Packer, Nomad etc.). While such grammar may end up replacing the current one in this Terraform plugin, it’s likely we would create a dedicated small HCL plugin that leverages the same grammar people can use if there isn’t a product-specific plugin (e.g. Packer one). i.e. a “Terraform” plugin likely will never claim to support plain hcl, but an “HCL” plugin would. This is not only for clean separation of concerns, but also to avoid problems where VS Code doesn’t seem to handle conflicts well between two plugins claiming the same file extension.
  • This matters for any other features, such as formatting, completion, hover, etc. which all require much deeper understanding of the flavour of HCL used by each individual product because each product uses different language constructs (block names, attributes, functions, way of formatting configs etc.). This could potentially be addressed by a dedicated Packer, Nomad etc. plugin which in turn talks to dedicated Packer/Nomad/… language server, similar to https://github.com/hashicorp/terraform-ls
1reaction
radeksimkocommented, Sep 10, 2021

Hi folks, https://github.com/hashicorp/vscode-terraform/issues/638 and https://github.com/hashicorp/vscode-terraform/issues/639 outline our plans for handling other non-Terraform HCL files.

TL;DR we plan to have a dedicated extension which would most likely claim *.hcl only and that extension would provide all HCL-generic functionality, such as highlighting that is relevant for any HCL file (without knowing whether it’s Terraform, Packer, Nomad, Waypoint or anything else).

In the interest of keeping conversations in one place I’m going to close this issue in favour of the two mentioned ones.

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extending HCL Commerce with xC extension points
After you develop xC extension code, you must register your extension code within the HCL Commerce database and assign extension code to extension...
Read more >
HashiCorp HCL - Visual Studio Marketplace
The HashiCorp HCL Extension is a grammar only extension targeted to provide HCL syntax highlighting for files not already accounted for by a ......
Read more >
Announcing the HCL Extension for Visual Studio Code 0.1
Today we announce that HashiCorp has transitioned the community HCL Extension to an officially supported project.
Read more >
HCL File Extension - What is .hcl and how to open?
Be careful not to rename the extension on .hcl files, or any other files. This will not change the file type. Only special...
Read more >
Introduction to HCL and HCL tooling - Octopus Deploy
An HCL extension to offer proper language colorization. · The Terraform extension that also adds HCL support, despite being named for one of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found