-
Notifications
You must be signed in to change notification settings - Fork 53
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
Parse errors make parsed tree useless #32
Comments
Any comments, why this is closed now? |
It's fixed by 53456f5. I will publish a new version in the coming days. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the following code snippet that can be run in node:
That produces the following correct output:
However if I run it on a slightly malformed object like so (two double quotes in
prp1
):I get a tree with two nodes which represent key and value of
prop1
:That makes it impossible to figure out which node is for example at offset
48
.My use case: I'm writing a VSCode extension for JSON completion. When the user starts typing, the object will always be malformed so that I get no information on the node which he is typing in.
Have you similar use cases and maybe solved it differently or is there any way to increase fault tolerance of the parser? My current workaround would be to remove the current word range from the text and parse the tree based on that. I'm by far not sure if this works in every possible situation.
The text was updated successfully, but these errors were encountered: