You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
749 B
33 lines
749 B
local M = {}
|
|
|
|
function M.setup()
|
|
local dap = require("dap")
|
|
dap.configurations.lua = {
|
|
{
|
|
type = "nlua",
|
|
request = "attach",
|
|
name = "Attach to running Neovim instance",
|
|
host = function()
|
|
local value = vim.fn.input("Host [127.0.0.1]: ")
|
|
if value ~= "" then
|
|
return value
|
|
end
|
|
return "127.0.0.1"
|
|
end,
|
|
port = function()
|
|
local val = tonumber(vim.fn.input("Port: ", "54321"))
|
|
assert(val, "Please provide a port number")
|
|
return val
|
|
end,
|
|
},
|
|
}
|
|
|
|
dap.adapters.nlua = function(callback, config)
|
|
callback({ type = "server", host = config.host, port = config.port })
|
|
end
|
|
end
|
|
|
|
function M.open()
|
|
require("osv").run_this()
|
|
end
|
|
return M
|
|
|