jneale / Xplore

Xplore: Developer Toolkit for ServiceNow
MIT License
193 stars 146 forks source link

Script Debugger in Xplore scripts #63

Open EricTherrien opened 2 years ago

EricTherrien commented 2 years ago

It's not a bug, but a new feature. I have looked a bit, maybe it's there, but I did not find it... sorry if it's me missing it.

It would be great if you could check a box or dispose of a "Run in Script Debugger" button and when you run your code it would open Script Debugger and step througth your code with a break point on the first line (or allow to add break point in the script)...

jneale commented 2 years ago

Great suggestion. Not sure how I go about this right now, may need some re-engineering. Will keep this open for future thought.

michaelnow-byteme commented 10 months ago

If I move my script / code into a Script Include and then call that from Xplore, I can use the debugger, it's just an extra step and it bypasses the ability to catch the gs.addInfoMessage and other logs - which I also love using. I really want to help on this, @jneale do you already have a plan for debugging brewing in the back of your mind? I'll devise my own if no... (love this plugin)

codaroma commented 4 months ago

btw it is possible to debug xplore scripts running in a non-global scope using the SN script debugger. Just set your breakpoint in the first line of the snd_Xplore_code script include. image image image

But this does not work for scripts run in the global scope because snd_Xplore_code is not used in that situation.

So I modified the snd_xplore processor so that all scopes use the snd_Xplore_code script include. image

In fact this is one of many changes I have made to Xplore. I hope this helps others.