Open SSlinky opened 1 week ago
Can't you just throw an error in your visitor to stop walking?
I would have thought, yeah. But I haven't been able to catch it sucessfully. I have written a vscode language client/server throwing seems to be caught by the package and reported to the client as the server experienced an unhandled error. Too many and it stops restarting it.
I'm open to the fact that it's likely my own lack of knowledge here.
A top level try/catch should do the job. For the exception you can use ParseCancellationException
which is specifically designed for use in early-out scenarios.
It would be really useful to be able to cancel a parse that is being executed. I've janked it in by modifying the node module, but that's not really the best solution. Below as an example in the walk method.