Open angelozerr opened 4 years ago
if Qute ends up generating bytecode for all its code rather than just interpret it then this should "just work" assuming we can generate proper source maps.... for now I believe Qute does interpret its while/for loops rather than generate it... question for @mkouba how far away this is.
Indeed, we don't compile the templates into bytecode. Instead, we parse a template into a tree of Java objects (nodes) and then execute these nodes when rendering the template at runtime. Also note that Qute resolves the nodes/expressions asynchronously and once everything is ready we synchronously build the output.
Indeed, we don't compile the templates into bytecode.
Great, so we will able to do like the old FreeMarker debugger support https://github.com/apache/freemarker/tree/a03a1473b65d9819674b285a0538fed824f37478/src/main/java/freemarker/debug
The basic idea is to add/remove a BreakPoint in the Template and when template is rendered, the debugger suspend the process until debugger is re-run.
Also note that Qute resolves the nodes/expressions asynchronously and once everything is ready we synchronously build the output.
We will need to experiment how to support that.
@maxandersen @mkouba do you like this idea about debugging Qute template?
@maxandersen @mkouba do you like this idea about debugging Qute template?
It might be useful but IMO a low priority feature...
I have started to write a POC in my spare time, and for the moment I can stop to the defined breakpoint:
It should be very nice if we could debug with breakpoint a Qute template by using https://microsoft.github.io/debug-adapter-protocol/
@maxandersen @mkouba what you think with this idea?