Open danielkrizian opened 8 years ago
Hi Daniel, Interesting. This should be doable but will require some work. I haven't looked at SublimeTextXdebug in details, but probably we can reuse the UI part and use https://github.com/quintanar401/dbg as a debuging engine.
Here is how I would do it
.d2.i[...]
.d2.xxx[...]
to step through the code, print environments, etc in a shortcut. Here i s an example of how I implement show mem short cut (shift+f5) https://github.com/komsit37/sublime-q/blob/master/q_send.py
class QSendMemCommand(QSendCommand):
def do(self, edit=None, input=None):
input = '.Q.w[]'
return super().do(input=input)
https://github.com/komsit37/sublime-q/blob/master/sublime/Default%20(Windows).sublime-keymap
{ "keys": ["shift+f5"], "command": "q_chain", "args": {"chain": ["q_send_mem", "q_out_panel"]}, "context":[{ "key": "selector", "operator": "equal", "operand": "source.q" }]}
The above should be straightforward. I think tricky part is how to deal with adding and removing breakpoint
Would debugging tool such as https://github.com/martomo/SublimeTextXdebug work with
sublime-q
?Poor man's method of setting breakpoints such as this one with
\e 1
toggle will freeze the Sublime Text session so individual lines can't beCtrl+Enter
'ed when trying to emulate stepping through the code in debug mode and examining the environment.Helpful command-line debugger is https://github.com/quintanar401/dbg, but that's quite verbose as each step requires wrapping the operation into
d2.xx[..]
. Visual debugger within Sublime Text would be great!