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

Initial HCL Support #5612

Merged
merged 24 commits into from
Apr 17, 2023
Merged

Initial HCL Support #5612

merged 24 commits into from
Apr 17, 2023

Conversation

lkishalmi
Copy link
Contributor

Well, I've restarted my HCL/Terraform Support efforts. This is just the base lexer supporting tfvar files, though the lexer, I hope, would work correctly on any HCL files. Parsers are in progress.

@matthiasblaesing could you have a glimpse on the licensing please?

The Terraform icon svg is coming from https://github.com/PKief/vscode-material-icon-theme/ repository. I kept the original as vscode-terraform.svg. Unfortunately it seems if I keep the name as terraform.svg the IDE would use that one over the png and fails as the svg has no size information.

@matthiasblaesing
Copy link
Contributor

For the icon, I would suggest this approach:

matthiasblaesing@7d52293

  • License information was put directly into the SVG. This should still be ok, as we are required to provide the license, but that is done through the file itself.
  • I renamed the svg to match the png and modified the SVG to make it possible to use it as icon source in NetBeans

@lkishalmi
Copy link
Contributor Author

@matthiasblaesing Thanks for the SVG! It seems to work, so I've removed the licenseinfo.xml and the derived png.
I think the nbbuild/licenses/MIT-vscode-material-icon-theme is still into the play, is it?

@matthiasblaesing
Copy link
Contributor

@matthiasblaesing Thanks for the SVG! It seems to work, so I've removed the licenseinfo.xml and the derived png. I think the nbbuild/licenses/MIT-vscode-material-icon-theme is still into the play, is it?

I think we have no instance of icons where we only store the SVG version. Providing a png fallback makes it possible for people to run without batik, to keep it common, IMHO you should keep the png.

@matthiasblaesing
Copy link
Contributor

For the commit validation problem on JDK 8, I suggest to drop javac.target from project.properties and change javac.source to 8. The javac task is modified to switch to using the release flag instead of target/source.

@mbien
Copy link
Member

mbien commented Mar 12, 2023

@lkishalmi I think @matthiasblaesing meant to downgrade the property to 8. You can't remove the properties otherwise NB won't know what language level the module has and everything will be red in the editor.

basically:
javac.source=1.8 and either remove target or set it to the same value which is fine too (I would recommend to set both so that it is nb-javac independent).

edit: i actually started working on providing a default value for everything - but got stuck and distracted by other things #5455

@lkishalmi lkishalmi added this to the NB18 milestone Apr 15, 2023
@lkishalmi lkishalmi marked this pull request as ready for review April 15, 2023 01:47
@lkishalmi
Copy link
Contributor Author

Well, this one is far from being complete. I even question some of my design decisions, though the base HCL lexer was as close to the (specs)[https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md] as I could get.

I'm not so sure that I'd keep the TerraformLexer, most probably it would be better to have parser adjusted highlight for different HCL flavors, but till I get there it is how it is.

The AST classes are also some very early implementations.

Anyway, the implementation works providing syntax highlight and folding for tfvars and tf files:
image

It also adds code templates for Terraform files.

Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. Haven't reviewed the grammar files.

@lkishalmi lkishalmi added the HCL label Apr 17, 2023
@lkishalmi lkishalmi merged commit d55aadc into apache:master Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants