You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
662 B
Lua
34 lines
662 B
Lua
2 years ago
|
local dapmode = require("spike.dapmode")
|
||
2 years ago
|
|
||
|
local M = {}
|
||
|
|
||
|
local function register_listeners()
|
||
|
local present, dap = pcall(require, "dap")
|
||
|
if not present then
|
||
|
print("nvim-dap missing !")
|
||
|
return
|
||
|
end
|
||
|
|
||
2 years ago
|
dap.listeners.before['event_initialized']['spike-dap'] = function(session, body)
|
||
2 years ago
|
dapmode.start()
|
||
|
end
|
||
|
|
||
2 years ago
|
dap.listeners.after['event_terminated']['spike-dap'] = function(session, body)
|
||
2 years ago
|
-- print("dap session ended")
|
||
|
dapmode.stop()
|
||
|
end
|
||
|
end
|
||
|
|
||
|
function M.go_debug()
|
||
|
local present, gdap = pcall(require, "go.dap")
|
||
|
if not present then return end
|
||
|
gdap.run()
|
||
|
end
|
||
|
|
||
|
function M.setup()
|
||
|
dapmode.setup({})
|
||
|
register_listeners()
|
||
|
end
|
||
|
|
||
|
return M
|