Lazy #1

Merged
DashieTM merged 38 commits from lazy into main 2023-03-08 10:38:05 +01:00
Showing only changes of commit 97277e458d - Show all commits

View file

@ -21,6 +21,7 @@ return {
"firefox", "firefox",
"bash", "bash",
"delve", "delve",
"coreclr",
}, },
automatic_installation = true, automatic_installation = true,
automatic_setup = true, automatic_setup = true,
@ -40,6 +41,9 @@ return {
command = "/usr/bin/lldb-vscode", command = "/usr/bin/lldb-vscode",
name = "lldb", name = "lldb",
} }
dap.adapters.nlua = function(callback, config)
callback({ type = "server", host = config.host or "127.0.0.1", port = config.port or 8086 })
end
local rust_dap = vim.fn.getcwd() local rust_dap = vim.fn.getcwd()
local filename = "" local filename = ""
@ -78,18 +82,11 @@ return {
dap.configurations.python = { dap.configurations.python = {
{ {
-- The first three options are required by nvim-dap
type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python` type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python`
request = "launch", request = "launch",
name = "Launch file", name = "Launch file",
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
program = "${file}", -- This configuration will launch the current file if used. program = "${file}", -- This configuration will launch the current file if used.
pythonPath = function() pythonPath = function()
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
-- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
local cwd = vim.fn.getcwd() local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then
return cwd .. "/venv/bin/python" return cwd .. "/venv/bin/python"
@ -103,7 +100,6 @@ return {
} }
dap.configurations.java = { dap.configurations.java = {
{ {
-- type = "javadbg",
request = "attach", request = "attach",
name = "Debug (Attach) - Remote", name = "Debug (Attach) - Remote",
hostName = "127.0.0.1", hostName = "127.0.0.1",
@ -124,7 +120,6 @@ return {
mode = "test", mode = "test",
program = "${file}", program = "${file}",
}, },
-- works with go.mod packages and sub packages
{ {
type = "delve", type = "delve",
name = "Debug test (go.mod)", name = "Debug test (go.mod)",
@ -156,10 +151,47 @@ return {
firefoxExecutable = "/usr/bin/firefox", firefoxExecutable = "/usr/bin/firefox",
}, },
} }
dap.configurations.lua = {
{
type = "nlua",
request = "attach",
name = "Attach to running Neovim instance",
},
}
dap.configurations.cs = {
{
type = "coreclr",
name = "launch - netcoredbg",
request = "launch",
program = function()
return vim.fn.input("Path to dll", vim.fn.getcwd() .. "/bin/Debug/", "file")
end,
},
}
dap.configurations.sh = {
{
type = "bashdb",
request = "launch",
name = "Launch file",
showDebugOutput = true,
pathBashdb = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/extension/bashdb_dir/bashdb",
pathBashdbLib = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/extension/bashdb_dir",
trace = true,
file = "${file}",
program = "${file}",
cwd = "${workspaceFolder}",
pathCat = "cat",
pathBash = "/bin/bash",
pathMkfifo = "mkfifo",
pathPkill = "pkill",
args = {},
env = {},
terminalKind = "integrated",
},
}
require("dapui").setup({ require("dapui").setup({
icons = { expanded = "", collapsed = "", current_frame = "" }, icons = { expanded = "", collapsed = "", current_frame = "" },
mappings = { mappings = {
-- Use a table to apply multiple mappings
expand = { "<CR>", "<2-LeftMouse>" }, expand = { "<CR>", "<2-LeftMouse>" },
open = "o", open = "o",
remove = "d", remove = "d",
@ -167,20 +199,10 @@ return {
repl = "r", repl = "r",
toggle = "t", toggle = "t",
}, },
-- Expand lines larger than the window
-- Requires >= 0.7
expand_lines = vim.fn.has("nvim-0.7") == 1, expand_lines = vim.fn.has("nvim-0.7") == 1,
-- Layouts define sections of the screen to place windows.
-- The position can be "left", "right", "top" or "bottom".
-- The size specifies the height/width depending on position. It can be an Int
-- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while
-- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
-- Elements are the elements shown in the layout (in order).
-- Layouts are opened in order so that earlier layouts take priority in window sizing.
layouts = { layouts = {
{ {
elements = { elements = {
-- Elements can be strings or table with id and size keys.
{ id = "scopes", size = 0.25 }, { id = "scopes", size = 0.25 },
"breakpoints", "breakpoints",
"stacks", "stacks",
@ -199,9 +221,7 @@ return {
}, },
}, },
controls = { controls = {
-- Requires Neovim nightly (or 0.8 when released)
enabled = true, enabled = true,
-- Display controls in this element
element = "repl", element = "repl",
icons = { icons = {
pause = "", pause = "",
@ -228,60 +248,6 @@ return {
max_value_lines = 100, -- Can be integer or nil. max_value_lines = 100, -- Can be integer or nil.
}, },
}) })
-- require("mason-nvim-dap").setup({
-- ensure_installed = {
-- "bash-debug-adapter",
-- "firefox-debug-adapter",
-- "js-debug-adapter",
-- "node-debug2-adapter",
-- "java-debug-adapter",
-- "debugpy",
-- },
-- automatic_installation = true,
-- automatic_setup = true,
-- })
-- require("mason-nvim-dap").setup_handlers({
-- function(source_name)
-- -- all sources with no handler get passed here
--
-- -- Keep original functionality of `automatic_setup = true`
-- require("mason-nvim-dap.automatic_setup")(source_name)
-- end,
-- python = function(source_name)
-- dap.adapters.python = {
-- type = "executable",
-- command = "/usr/bin/python3",
-- args = {
-- "-m",
-- "debugpy.adapter",
-- },
-- }
--
-- dap.configurations.python = {
-- {
-- type = "python",
-- request = "launch",
-- name = "Launch file",
-- program = "${file}", -- This configuration will launch the current file if used.
-- },
-- }
-- end,
-- })
local dap = require("dap")
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
require("nvim-dap-virtual-text").setup() require("nvim-dap-virtual-text").setup()
end, end,
}, },