tomblind / local-lua-debugger-vscode

Local Lua Debugger for VSCode
MIT License
106 stars 26 forks source link

Support for multiple threads? #61

Open freds72 opened 2 years ago

freds72 commented 2 years ago

Use Löve framework, I am spawning a new lua thread:

    gameThread = love.thread.newThread( lf.read("host.lua") )
    gameThread:start(unpack(args))

The breakpoints in that second thread are ignored so far. Is that supported by the debugger?

edit: got it work by starting debugger in second thread only - works ok in my case (but probably worth a note in documentation)

tomblind commented 2 years ago

It looks like these are separate Lua contexts, so yeah, individual debugger instances would be needed for each one on the Lua side. I don't support having the plugin work with multiple debuggers at once but that seems like it would be do-able.

I'm curious: when running in the 2nd thread, do you have any issues with file+line locations? The file is read in manually and passed to the thread as text, so I'd be surprised if that information was retained.

freds72 commented 2 years ago

Only 1 "bootstrap" file is loaded as a string, the rest is using standard require() and happens to work just fine with the debugger.