We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
srcRange
When a HCL file starts with a multiline comment, the SrcRange of the hclsyntax.Body starts after the multiline comment.
SrcRange
hclsyntax.Body
Example file starting with a multiline comment:
/******************************** Some comment ********************************/ data "google_project" "project" { project_id = var.project_id }
Example code for parsing the file:
f, _ := hclsyntax.ParseConfig(src, filename, pos) body, _ := f.Body.(*hclsyntax.Body) fmt.Println(body.Range())
Full example here: https://gist.github.com/dbanck/83e0e7936556eab2184d5d89e9d1feac
SrcRange for the example file should be main.tf:1,1-8,1
main.tf:1,1-8,1
SrcRange for the example file is reported as main.tf:3,34-8,1
main.tf:3,34-8,1
The text was updated successfully, but these errors were encountered:
out of range
Any updates on this? I'll still facing this as of today.
Sorry, something went wrong.
No branches or pull requests
When a HCL file starts with a multiline comment, the
SrcRange
of thehclsyntax.Body
starts after the multiline comment.Test data
Example file starting with a multiline comment:
Example code for parsing the file:
Full example here: https://gist.github.com/dbanck/83e0e7936556eab2184d5d89e9d1feac
Expected behavior
SrcRange
for the example file should bemain.tf:1,1-8,1
Actual behavior
SrcRange
for the example file is reported asmain.tf:3,34-8,1
The text was updated successfully, but these errors were encountered: