Lua debugging with local-lua-debugger failing #1245
-
Hi! I have followed the instructions here to configure the adapter and then created configurations based on the instructions in local-lua-debugger's repo. I've tried debugging regular lua code and also debugging a love2d game, but the same problem happens in both. As soon as I call After failing a lot, I tried to intercept the stdin and stdout of the debugger to investigate. As far as I understand, it seems to exchange the first messages normally and then exit with no apparent reason, but since I don't know much about DAP, I'm pasting it here so you can analyze debugger's stdin:
debugger's stdout:
This is all I have. Can anyone help me? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Could you also post the I managed to reproduce the error only if I left out the
To fix it and get it working I then used a {
"version": "0.2.0",
"configurations": [
{
"name": "Debug Love",
"type": "local-lua",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": {
"command": "love"
},
"args": [
"."
],
"scriptRoots": [
"game"
]
}
]
} And a if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
require("lldebugger").start()
end
local love = require("love")
function love.draw()
love.graphics.print("Hello World!", 400, 300)
end |
Beta Was this translation helpful? Give feedback.
-
I have the same problem. Can someone tell me what is wrong? local dap = require("dap")
dap.adapters["local-lua"] = {
type = "executable",
command = "node",
args = {
"C:\\Users\\48514\\Documents\\luadebug\\local-lua-debugger-vscode\\extension\\debugAdapter.js",
},
enrich_config = function(config, on_config)
local c = vim.deepcopy(config)
if not config.extensionPath then
c.extensionPath = "C:\\Users\\48514\\Documents\\luadebug\\local-lua-debugger-vscode"
end
on_config(c)
end,
}
dap.configurations.lua = {
{
name = "Debug Love",
type = "local-lua",
request = "launch",
cwd = "${workspaceFolder}",
program = {
command = "love"
},
args = {
"game"
},
scriptRoots = {
"game"
}
}
} Logs
I tried also simply: local dap = require("dap")
dap.adapters.lua = {
type = "executable",
command = "node",
args = {
"C:\\Users\\48514\\Documents\\luadebug\\local-lua-debugger-vscode\\extension\\debugAdapter.js",
},
}
dap.configurations.lua = {
{
type = "lua",
name = "Debug",
request = "launch",
cwd = "${workspaceFolder}",
program = "${file}",
}
} |
Beta Was this translation helpful? Give feedback.
Could you also post the
:DapShowLog
output?I managed to reproduce the error only if I left out the
cwd
property in the configuration. Maybe you're missing that?It resulted in this message: