nvim: big dap changes:
go: launch dlv manually and add a mapping to set the port (dsp) python: get rid of it for now lldb: include lldb for rust and c
This commit is contained in:
@ -1 +0,0 @@
|
||||
require("dap-go").setup()
|
||||
@ -1,37 +1,7 @@
|
||||
local dap = require("dap")
|
||||
|
||||
--
|
||||
-- python
|
||||
--
|
||||
|
||||
dap.adapters.python = {
|
||||
type = "executable",
|
||||
command = "python",
|
||||
args = { "-m", "debugpy.adapter" },
|
||||
}
|
||||
|
||||
dap.configurations.python = {
|
||||
{
|
||||
type = "python",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
|
||||
program = "${file}",
|
||||
pythonPath = function()
|
||||
local cwd = vim.fn.getcwd()
|
||||
if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then
|
||||
return cwd .. "/venv/bin/python"
|
||||
elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then
|
||||
return cwd .. "/.venv/bin/python"
|
||||
else
|
||||
return "/usr/bin/python"
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
--
|
||||
-- C
|
||||
-- lldb
|
||||
--
|
||||
|
||||
dap.adapters.lldb = {
|
||||
@ -40,18 +10,66 @@ dap.adapters.lldb = {
|
||||
name = "lldb",
|
||||
}
|
||||
|
||||
dap.configurations.c = {
|
||||
local lldb = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "lldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
return vim.fn.input("path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
|
||||
runInTerminal = false,
|
||||
runInTerminal = true,
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.c = lldb
|
||||
dap.configurations.rust = lldb
|
||||
|
||||
--
|
||||
-- go
|
||||
--
|
||||
|
||||
vim.keymap.set("n", "<leader>dsp", function()
|
||||
local port = vim.fn.input("enter port for delve: ")
|
||||
dap.adapters.go.port = port
|
||||
print("now run 'dlv dap -l 127.0.0.1:" .. port .. "'")
|
||||
end)
|
||||
|
||||
dap.adapters.go = {
|
||||
type = "server",
|
||||
host = "127.0.0.1",
|
||||
port = 38000,
|
||||
}
|
||||
|
||||
dap.configurations.go = {
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug",
|
||||
request = "launch",
|
||||
program = "${file}",
|
||||
},
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug Package",
|
||||
request = "launch",
|
||||
program = "${fileDirname}",
|
||||
},
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug test",
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "${file}",
|
||||
},
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug test (go.mod)",
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "./${relativeFileDirname}",
|
||||
},
|
||||
}
|
||||
|
||||
@ -1 +0,0 @@
|
||||
require("dapui").setup()
|
||||
@ -15,3 +15,25 @@ lsp.gopls.setup({})
|
||||
lsp.clangd.setup({})
|
||||
lsp.texlab.setup({})
|
||||
lsp.rust_analyzer.setup({})
|
||||
lsp.sumneko_lua.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@ -16,6 +16,10 @@ wk.register({
|
||||
o = "Step Out",
|
||||
p = "List Breakpoints",
|
||||
q = "Stop",
|
||||
s = {
|
||||
name = "Set DAP Variables",
|
||||
p = "Delve Port",
|
||||
},
|
||||
u = "Toggle UI",
|
||||
v = "Show Variables",
|
||||
},
|
||||
@ -68,13 +72,11 @@ wk.register({
|
||||
X = "Quit All Without Saving",
|
||||
c = "Toggle All Terminal",
|
||||
f = "File Manager",
|
||||
f = "File Manager",
|
||||
h = "Left Split",
|
||||
j = "Down Split",
|
||||
k = "Up Split",
|
||||
l = "Right Split",
|
||||
q = "Quit",
|
||||
s = "Save",
|
||||
x = "Quit Without Saving",
|
||||
}, { prefix = "<leader>" })
|
||||
wk.setup({})
|
||||
|
||||
Reference in New Issue
Block a user