How to get started writing a custom (js like language) script debugger?

I'm exploring the idea of adding a custom script debugger to my plugin for working with Salesforce Commerce Cloud and wondering where to get started. The scripting language is essentially a Rhino based JS scripting language and there is a REST API to interact with the server environment to start and stop threads and create breakpoints, etc...

I started digging into this a bit and found that there seems to be a few different debugger implementations and I wanted to know which one would be most appropriate given the type of debugger I would like to write.

I didn't know if it would be possible to marshal the responses into a format the JS debugger already understands or if I will need to write an entire custom implementation with the XDebugger.

More information about the script debugging API can be found here.

https://documentation.b2c.commercecloud.salesforce.com/DOC2/index.jsp?topic=%2Fcom.demandware.dochelp%2FScriptDebuggerAPI%2Flatest%2Fusage%2FScriptDebuggerAPI.html

Any help would be greatly appreciated!

0
4 comments

It would be not so easy to reuse JavaScript debugger, but you may take a look at intellij.platform.scriptDebugger modules, on which JavaScript debugger is also based.

0

Thanks Konstantin! I'll definitely take a look at this. Is the JS debugger open source so I can take a look at how to extend this or do you know of any plugins that also use the scriptDebugger? It looks like this has all the pieces, but right now it's a little over my head :D

I might also have to start getting deeper into learning Kotlin as well :D

0

Unfortunately, JavaScript and Go debuggers which I'm aware of using it are not open-source.

0

Thanks Konstantin!

If anyone has any other ideas of where to look for examples of implementing the script debugger they would greatly be appreciated!

0

Please sign in to leave a comment.