37 lines
736 B
Lua
37 lines
736 B
Lua
local M = {}
|
|
|
|
function M.setup(config)
|
|
local dap = require("dap")
|
|
local dapui = require("dapui")
|
|
|
|
dap.adapters.godot = {
|
|
type = "server",
|
|
host = config.editor_host or "127.0.0.1",
|
|
port = config.debug_port or 6006,
|
|
}
|
|
|
|
dap.configurations.gdscript = {
|
|
{
|
|
type = "godot",
|
|
request = "launch",
|
|
name = "Launch scene",
|
|
project = "${workspaceFolder}",
|
|
launch_scene = true,
|
|
},
|
|
}
|
|
|
|
dapui.setup()
|
|
|
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
|
dapui.open()
|
|
end
|
|
dap.listeners.before.event_terminated["dapui_config"] = function()
|
|
dapui.close()
|
|
end
|
|
dap.listeners.before.event_exited["dapui_config"] = function()
|
|
dapui.close()
|
|
end
|
|
end
|
|
|
|
return M
|