This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Sewbacca's profile picture

How debug CC with Visual Studio Code

Started by Sewbacca, 13 June 2016 - 12:09 PM
Sewbacca #1
Posted 13 June 2016 - 02:09 PM
I had found this nice program: Visual Studio Code.
And I found out that this program can debug my programs.
Is it possible to debug Computercraft in a command console of windows with Visual Studio Code?
SquidDev #2
Posted 13 June 2016 - 02:25 PM
Yes and no. It is possible but it won't be easy.

For you to be able debug a program you must implement the debug protocol that VS Code uses which requires sockets. You'll also need to use Lua's debug library to implement breakpoints, stepping through code and getting local variables. Thankfully CCTweaks adds both a socket API and the debug API so you can then interact with VS Code. You might also want to look at some other Lua debuggers to see how to implement this.

If you do choose to have a go feel free to ask for help: this is something I've wanted to do for a while but haven't had time.
Edited on 13 June 2016 - 12:25 PM