summaryrefslogtreecommitdiffstats
path: root/.config/nvim/plugin/50-dap.lua
blob: 6e6eea15c30a679a65edc851550a746839cd3f1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--
-- DAP client/adapter configurations
--

local dap = require("dap")

-- OSV configuration
local osv = require("osv")

dap.configurations.lua = {
	{
		type = "nlua",
		request = "attach",
		name = "Attach to running Neovim instance",
	},
}
dap.adapters.nlua = function(callback, config)
	callback({ type = "server", host = config.host or "127.0.0.1", port = config.port or 8086 })
end
vim.api.nvim_create_user_command("OSVLaunch", function()
	osv.launch({ port = 8086 })
end, { desc = "Launch OSV server" })
vim.api.nvim_create_user_command("OSVStatus", function()
	vim.notify("OSV server running: " .. tostring(osv.is_running()))
	vim.notify("OSV client attached: " .. tostring(osv.is_attached()))
end, { desc = "Show OSV status" })