if you’ve EVER tried to debug a Xojo Script its truly a pain in the rear end
Since one of my current projects requires a lot of Xojo Script that became really apparent and really annoying
So, for this project, we made a XojoScript debugger 😛
You can run & single step. And with each step the values of all variables in scope will be reported; where possible. Since there’s no introspection in XojoScript I cant make it dump out the values of properties of classes or other reference types 🙁
But – here’s what it looks like so far 😛
Ooooo. I use Xojoscript a _lot_. Any chance this will be available to the unwashed masses? Or at least a description of how it works (I imagine there’s a lot of injected Xojoscript code, and context interaction.
Have to discuss this with my client about how/if it can be made public
Indeed there is a TON of work in this to make it work at all
AFAIK, the Xojo debugger simply inserts extra lines between the user-written code, correct? I assume you do the same?
Now, if you had a parser that creates an AST, then you could also know the used args in any file, or inside a function, and then insert lines to pass them to the debugger whenever they’re possibly changing.
If you like to do that, I can share my AST parser with you (it’s based on Jon Johnson’s parser and is ready to work with the old syntax, but updating it for the new syntax (“var” instead of “dim” etc.) shouldn’t be hard, either.
I dont quite get to the point of needing an AST to insert code but yes I do a LOT of instrumentation in much the same way
When I add in the context call-backs it makes it possible to do what I do
However, right now my big hang up is that in order to make it possible to step I need to run the XojoScript in a thread so the UI can remain responsive
And having to use a thread causes other issues I need to figure out how to solve when/if the code in the script needs to, through context methods, access the UI since now I get a thread accessing ui exception
Just another puzzle to sort out