Noticed new Lua Debugger for VSCode

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
ianfitz
Prole
Posts: 10
Joined: Sun Jan 03, 2016 8:32 pm

Noticed new Lua Debugger for VSCode

Post 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.
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Noticed new Lua Debugger for VSCode

Post 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?
ianfitz
Prole
Posts: 10
Joined: Sun Jan 03, 2016 8:32 pm

Re: Noticed new Lua Debugger for VSCode

Post 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!
User avatar
D0NM
Party member
Posts: 250
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: Noticed new Lua Debugger for VSCode

Post by D0NM »

Hi guys!
Are there any news about smooth debugging of Love2D
with VS Code?
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:
treenode
Prole
Posts: 1
Joined: Mon Jun 08, 2020 3:28 pm

Re: Noticed new Lua Debugger for VSCode

Post 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.
Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 79 guests