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

Add a public parser which returns hcl.Diagnostics to make life easier for community tooling (LSP) #20026

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anthonymq
Copy link

Hello,
I'm building a Nomad LSP and It would be super useful for this kind of community tooling if you could expose a parser which returns hcl.Diagnostics.
Here is a PR that add this public method without breaking changes.
Let me know if you need some changes.
Thanks

@hashicorp-cla
Copy link

hashicorp-cla commented Feb 22, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

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

Hi @anthonymq and thanks for raising this PR. I've taken a quick initial pass through the changes and I think it would be better to have the decode function return a single object of hcl.Diagnostics rather than two objects such as return diags, diags. The callers can then handle whether to keep the original object type, or convert this to an error.

@anthonymq
Copy link
Author

Hi @jrasell, thanks for the response. I made the change. Makes sense.

@tgross tgross added the stage/needs-rebase This PR needs to be rebased on main before it can be backported to pick up new BPA workflows label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/needs-rebase This PR needs to be rebased on main before it can be backported to pick up new BPA workflows
Development

Successfully merging this pull request may close these issues.

None yet

4 participants