Page 1 of 1

Noticed new Lua Debugger for VSCode

Posted: Sun Jan 01, 2017 5:11 am
by ianfitz
I just noticed this, seems new, anyone tried it?

https://marketplace.visualstudio.com/it ... .lua-debug

I've been wanting to make the switch from Sublime to VSCode for a while as it has some nifty IDE-like features, but still can be configured to have the minimalist look I dig from Sublime. One thing I had been waiting for is a good debugger I can use with Lua 5.1, this looks like it...

Seems to be made my a Korean mobile game dev studio, that is using Gideros, another gamedev framework that uses Lua so purposes seem similar.

Re: Noticed new Lua Debugger for VSCode

Posted: Mon Jan 02, 2017 10:35 am
by SiENcE
Thanks for this hint.

I just tried it, you only need to add this into the vs-code debug configuration file.

Code: Select all

       {
            "name": "launch-löve",
            "type": "lua",
            "request": "launch",
            "workingDirectory": "${workspaceRoot}",
            "executable": "${workspaceRoot}/../092/love.exe",
            "arguments": "./",
            "listenPublicly": false,
            "listenPort": 56789,
            "encoding": "UTF-8"
        },
Add this into your main.lua after loading all your other required files:

main.lua

Code: Select all

-- requires

local json = require 'lib/debug/dkjson'
local debuggee = require 'lib/debug/vscode-debuggee'
local startResult, breakerType = debuggee.start(json)
print('debuggee start ->', startResult, breakerType)

-- code
and this into your love.update function:

Code: Select all

function love.update(dt)
	if debuggee then debuggee.poll() end
end

Breakpoint and watches are working, but stepping through the code should work, but sadly does not. Any hints?

Re: Noticed new Lua Debugger for VSCode

Posted: Tue Jan 03, 2017 4:18 am
by ianfitz
Breakpoint and watches are working, but stepping through the code should work, but sadly does not. Any hints?
Ah that's too bad step through doesn't work. Unfortunately can't offer any hints, as after I posted I saw this is Windows only, and I'm on a Mac :(. Glad it was useful for you thought!

Re: Noticed new Lua Debugger for VSCode

Posted: Fri Jul 26, 2019 7:30 pm
by D0NM
Hi guys!
Are there any news about smooth debugging of Love2D
with VS Code?

Re: Noticed new Lua Debugger for VSCode

Posted: Mon Jun 08, 2020 3:31 pm
by treenode
Hi!
If some one else interested in debugging with code, here is a link.
https://github.com/tomblind/local-lua-debugger-vscode
This was working for me so far.