blob: 683984caee611aef033673c07daa0baa60cae0e0 (
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
27
28
|
--
-- DAP client/adapter configurations
--
vim.pack.add({ "https://github.com/mfussenegger/nvim-dap" }) -- DAP (Debug Adapter Protocol) client
local dap = require("dap")
-- OSV configuration
vim.pack.add({ "https://github.com/jbyuki/one-small-step-for-vimkind" }) -- DAP adapter for Neovim Lua
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" })
|