Replies: 3 comments 2 replies
-
|
This works for me: local dap = require("dap")
dap.adapters["local-lua"] = {
type = "executable",
command = "node",
args = {
vim.fs.joinpath(vim.fn.stdpath("data"), "mason/share/local-lua-debugger-vscode/extension/debugAdapter.js"),
},
}
dap.configurations.lua = {
{
name = "Launch current file debugging",
type = 'local-lua',
request = 'launch',
cwd = '${workspaceFolder}',
extensionPath = vim.fs.joinpath(vim.fn.stdpath("data"), "mason/share/local-lua-debugger-vscode/"),
program = function()
return {
lua = "lua",
file = vim.api.nvim_buf_get_name(0),
}
end,
verbose = true,
args = {},
},
}localluadebug.mp4relevant: |
Beta Was this translation helpful? Give feedback.
-
TL;DRIt seems Whole thingIf it's still unclear - you didn't need the Since the extra file (script) doesn't have to be distributed with the config, though, I've come to think it's okay to leave it to the end-user to find out they need an extra call in their project. If anything, there could be a custom message (from the adapter's config) displayed in Neovim during the 1st debugger run... But I think it's the extent of what's sensible. My lovely voiceVideo explanation to prove I'm not making things up 😆 2025-05-15.14-18-10.mp4Minimal exampleYour proposed config won't start Love2D projects, so if you want to reproduce it, use mine (again, because File system structure: test-app # this has to be CWD
└── main.lua
1 directory, 1 file
-- require('lldebugger').start()
function love.draw()
print('breakpoint here')
love.graphics.print("Hello World", 300, 200)
end |
Beta Was this translation helpful? Give feedback.
-
|
I asked in multiple Love2D communities. There's not enough interest to add extra runners, a.k.a. complicate this repo's code. Closing. Have a good one! |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I'm trying to make a PR for mason-nvim-dap, so it'd provide a default config for
local-lua-debugger-vscodeout of the box, but I'm "missing a feature", so to speak.The
mason-nvim-dapaddon provides configs for debug adapters installed via Mason -local-lua-debugger-vscodeis the only entry in Mason's DAP tab after filtering for Lua. But it requires more than just setting upadaptersandconfigurationsentries, and now I'm stuck. For the debugger to attach, the debugged process needs to callrequire('lldebugger').start(). What's worse,lldebuggeris a package withinlocal-lua-debugger-vscodedirectory, and the debugged process is a separate instance of whatever is interpreting Lua at a time, so that path is unknown in that context. Any idea how to solve that sensibly? I asked the mason-nvim-dap people as well, but I feel it's something that'll require coordination fromnvim-dap, or maybe even Mason.As I said, a config is required, e.g.:
...but also the project has to require the
lldebuggerpackage. I was thinking it could be solved by providing an extra script alongside the default configuration:...but even then, the user will have to know to copy that script into their project, and add
require('lldebug')at the beginning of theirmain.lua:Have a necessity for extra steps like that ever come up before?
Beta Was this translation helpful? Give feedback.
All reactions