json: Add json.ParseWithStartPos function#389
Conversation
|
Hi @wata727! Thanks for working on this and sorry for the slow response. There are many callers of this function outside of the HCL codebase, so I think unfortunately we must retain API compatibility here, even though indeed the I like your proposed compromise of adding a new function. I'd suggest to call it Does that sound reasonable to you? Thanks again! |
c0d4ee5 to
3402913
Compare
|
@apparentlymart Thank you for your review. Agreed with your suggestion. |
3402913 to
ae3439e
Compare
|
Thanks @wata727! I've merged it. I'm going to wait a little while before tagging a new release because I'm currently in the review process for some other PRs and so I'd ideally like to include them all into the same release tag. |
|
Hi @apparentlymart, sorry to ping you in an old PR. Do you have any ETA on when you will be tagging a new release? |
Similar to
hclsyntax.ParseConfig, this PR changes the start position to be passed to thejson.Parsefunction.This feature is necessary to transfer
hcl.Blockvia RPC. We need to be able to specify the start position when we take a partial JSON and parse it on the other side. See also #332 #381However, I understand that this change breaks backward compatibility. I propose this change for interface consistency, but if you care about compatibility, I could add a parsing function that accepts positions (e.g.
json.ParseWithPos). Please tell me your opinion.