Skip to content
Snippets Groups Projects
Commit a799c8ab authored by Jan Hensel's avatar Jan Hensel
Browse files

nvim: add/update some dap stuff

parent 0d868860
No related branches found
No related tags found
No related merge requests found
......@@ -54,12 +54,12 @@ local plugins = {
require("ztf.lsp")
end,
},
'mfussenegger/nvim-dap',
{
'mfussenegger/nvim-dap',
},
{
"rcarriga/nvim-dap-ui",
lazy = true,
config = function() require("ztf.configure.dapui") end,
dependencies = { "mfussenegger/nvim-dap" },
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
},
-- rust
{
......@@ -80,7 +80,46 @@ local plugins = {
'leoluz/nvim-dap-go',
lazy = true,
ft = 'go',
config = function() require("ztf.configure.dap-go") end,
opts = {
-- -- Additional dap configurations can be added.
-- -- dap_configurations accepts a list of tables where each entry
-- -- represents a dap configuration. For more details do:
-- -- :help dap-configuration
dap_configurations = {
{
-- Must be "go" or it will be ignored by the plugin
type = "go",
name = "Attach remote",
mode = "remote",
request = "attach",
},
},
delve = {
port = "38697",
},
-- -- delve configurations
-- delve = {
-- -- the path to the executable dlv which will be used for debugging.
-- -- by default, this is the "dlv" executable on your PATH.
-- path = "dlv",
-- -- time to wait for delve to initialize the debug session.
-- -- default to 20 seconds
-- initialize_timeout_sec = 20,
-- -- a string that defines the port to start delve debugger.
-- -- default to string "${port}" which instructs nvim-dap
-- -- to start the process in a random available port
-- port = "${port}",
-- -- additional args to pass to dlv
-- args = {},
-- -- the build flags that are passed to delve.
-- -- defaults to empty string, but can be used to provide flags
-- -- such as "-tags=unit" to make sure the test suite is
-- -- compiled during debugging, for example.
-- -- passing build flags using args is ineffective, as those are
-- -- ignored by delve in dap mode.
-- build_flags = "",
-- },
},
dependencies = { 'mfussenegger/nvim-dap' },
},
{
......@@ -90,9 +129,31 @@ local plugins = {
},
-- lua
{
'folke/neodev.nvim',
opts = {},
}, -- formerly 'folke/lua-dev.nvim'
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = "luvit-meta/library", words = { "vim%.uv" } },
{ plugins = { "nvim-dap-ui" }, types = true },
},
},
},
{ -- optional `vim.uv` typings
"Bilal2453/luvit-meta",
lazy = true
},
{ -- optional completion source for require statements and module annotations
"hrsh7th/nvim-cmp",
opts = function(_, opts)
opts.sources = opts.sources or {}
table.insert(opts.sources, {
name = "lazydev",
group_index = 0, -- set group index to 0 to skip loading LuaLS completions
})
end,
},
-- nushell
{
......
require('dap-go').setup {
-- -- Additional dap configurations can be added.
-- -- dap_configurations accepts a list of tables where each entry
-- -- represents a dap configuration. For more details do:
-- -- :help dap-configuration
dap_configurations = {
{
-- Must be "go" or it will be ignored by the plugin
type = "go",
name = "Attach remote",
mode = "remote",
request = "attach",
},
},
delve = {
port = "38697",
},
-- -- delve configurations
-- delve = {
-- -- the path to the executable dlv which will be used for debugging.
-- -- by default, this is the "dlv" executable on your PATH.
-- path = "dlv",
-- -- time to wait for delve to initialize the debug session.
-- -- default to 20 seconds
-- initialize_timeout_sec = 20,
-- -- a string that defines the port to start delve debugger.
-- -- default to string "${port}" which instructs nvim-dap
-- -- to start the process in a random available port
-- port = "${port}",
-- -- additional args to pass to dlv
-- args = {},
-- -- the build flags that are passed to delve.
-- -- defaults to empty string, but can be used to provide flags
-- -- such as "-tags=unit" to make sure the test suite is
-- -- compiled during debugging, for example.
-- -- passing build flags using args is ineffective, as those are
-- -- ignored by delve in dap mode.
-- build_flags = "",
-- },
}
require'dapui'.setup({
controls = {
-- element = "repl",
-- enabled = true,
icons = {
disconnect = "STOP",
pause = "PAUSE",
play = "PLAY",
run_last = "LAST",
step_back = "BACK",
step_into = "INTO",
step_out = "OUT",
step_over = "OVER",
terminate = "TERM"
}
},
-- element_mappings = {},
-- expand_lines = true,
-- floating = {
-- border = "single",
-- mappings = {
-- close = { "q", "<Esc>" }
-- }
-- },
-- force_buffers = true,
-- icons = {
-- collapsed = "",
-- current_frame = "",
-- expanded = ""
-- },
-- layouts = { {
-- elements = { {
-- id = "scopes",
-- size = 0.25
-- }, {
-- id = "breakpoints",
-- size = 0.25
-- }, {
-- id = "stacks",
-- size = 0.25
-- }, {
-- id = "watches",
-- size = 0.25
-- } },
-- position = "left",
-- size = 40
-- }, {
-- elements = { {
-- id = "repl",
-- size = 0.5
-- }, {
-- id = "console",
-- size = 0.5
-- } },
-- position = "bottom",
-- size = 10
-- } },
-- mappings = {
-- edit = "e",
-- expand = { "<CR>", "<2-LeftMouse>" },
-- open = "o",
-- remove = "d",
-- repl = "r",
-- toggle = "t"
-- },
-- render = {
-- indent = 1,
-- max_value_lines = 100
-- }
})
-- local dap = require('dap')
--
-- dap.adapters.delve = {
-- type = 'server',
-- port = '${port}',
-- executable = {
-- command = 'dlv',
-- args = {'dap', '-l', '127.0.0.1:${port}'},
-- }
-- }
--
-- -- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md
-- dap.configurations.go = {
-- {
-- type = "delve",
-- name = "Debug",
-- request = "launch",
-- program = "${file}"
-- },
-- {
-- type = "delve",
-- name = "Debug test", -- configuration for debugging test files
-- request = "launch",
-- mode = "test",
-- program = "${file}"
-- },
-- -- works with go.mod packages and sub packages
-- {
-- type = "delve",
-- name = "Debug test (go.mod)",
-- request = "launch",
-- mode = "test",
-- program = "./${relativeFileDirname}"
-- }
-- }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment