feat(dap): remove dap

not used
This commit is contained in:
2024-04-20 15:17:00 +02:00
parent 80782ffd67
commit 2e36ef05d9
4 changed files with 0 additions and 201 deletions
-12
View File
@@ -76,18 +76,6 @@ local plugins = {
lazy = true,
event = "VimEnter",
},
{
"mfussenegger/nvim-dap",
config = require("plugins.dap").setup,
},
{
"rcarriga/nvim-dap-ui",
config = require("plugins.dap_ui"),
dependencies = {
"mfussenegger/nvim-dap",
"nvim-neotest/nvim-nio",
},
},
{
"tpope/vim-fugitive",
config = require("plugins.fugitive"),
-87
View File
@@ -1,87 +0,0 @@
-- https://github.com/mfussenegger/nvim-dap
local M = {}
M.env_ok = false
function M.check_env()
local utils = require("utils")
utils.assert_installed("python3")
utils.assert_python3_module_installed("debugpy")
M.env_ok = true
end
function M.start(config)
local dap = require("dap")
if not M.env_ok then
M:check_env()
end
dap.adapters.python = {
type = "executable",
command = "python",
args = { "-m", "debugpy.adapter", },
cwd = vim.fn.getcwd(),
}
dap.run(config)
-- List of events described at https://microsoft.github.io/debug-adapter-protocol/specification#Events
-- Also see :h dap-extensions
dap.listeners.after["event_initialized"]["nvim-dap.lua"] = function ()
dap.set_exception_breakpoints({ "userUnhandled", })
end
end
function M.launch(args)
assert(type(args) == "table", "Args not specified or of wrong type")
local config = {
name = "Launch file",
type = "python",
request = "launch",
program = "${file}",
-- python = 'python';
-- program = vim.fn.getcwd() .. '/.venv/bin/pytest';
console = "integratedTerminal",
args = args,
}
M.start(config)
end
function M.pytest(args)
assert(type(args) == "table", "Args not specified or of wrong type")
local config = {
name = "pytest " .. table.concat(args, " "),
type = "python",
request = "launch",
-- pythonPath = vim.fn.getcwd() .. '/.venv/bin/python',
module = "pytest",
-- python = 'python';
-- program = vim.fn.getcwd() .. '/.venv/bin/pytest';
args = args,
console = "integratedTerminal",
-- program = "${file}";
}
M.start(config)
end
function M.setup()
local dap = require("dap")
vim.keymap.set("n", "<F5>", dap.continue)
vim.keymap.set("n", "<F10>", dap.step_over)
vim.keymap.set("n", "<F11>", dap.step_into)
vim.keymap.set("n", "<F12>", dap.step_out)
--[[
TODO: Add this after loading dap for integrating catppuccin:
local sign = vim.fn.sign_define
sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = ""})
sign("DapBreakpointCondition", { text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = ""})
sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = ""})
--]]
end
return M
-47
View File
@@ -1,47 +0,0 @@
-- https://github.com/rcarriga/nvim-dap-ui
local function setup()
require("dapui").setup({
icons = { expanded = "", collapsed = "", },
mappings = {
-- Use a table to apply multiple mappings
expand = { "<CR>", "<2-LeftMouse>", },
open = "o",
remove = "d",
edit = "e",
repl = "r",
toggle = "t",
},
layouts = {
{
elements = {
"scopes",
"breakpoints",
"stacks",
"watches",
},
size = 40,
position = "left",
},
{
elements = {
"repl",
"console",
},
size = 10,
position = "bottom",
},
},
floating = {
max_height = nil, -- These can be integers or a float between 0 and 1.
max_width = nil, -- Floats will be treated as percentage of your screen.
border = "single", -- Border style. Can be "single", "double" or "rounded"
mappings = {
close = { "q", "<Esc>", },
},
},
windows = { indent = 1, },
})
end
return setup
-55
View File
@@ -1,55 +0,0 @@
-- TODO: clean this up.
-- For other readers: I don't currently use this, and is probably broken.
-- This was started as a work in progress a long time ago.
local utils = require("utils")
local M = {}
local env_ok = false
local dap = nil
local function check_env()
utils.assert_installed("python3")
utils.assert_python3_module_installed("debugpy")
utils.assert_python3_module_installed("pytest")
env_ok = true
end
function M.run(args)
assert(type(args) == "table", "Args not specified or of wrong type")
if not env_ok then
check_env()
end
if not dap then
dap = require("dap")
dap.adapters.python = {
type = "executable",
command = "python3",
args = { "-m", "debugpy.adapter", },
cwd = vim.fn.getcwd(),
}
end
local config = {
name = "pytest " .. table.concat(args, " "),
type = "python",
request = "launch",
-- pythonPath = vim.fn.getcwd() .. '/.venv/bin/python',
module = "pytest",
-- python = 'python';
-- program = vim.fn.getcwd() .. '/.venv/bin/pytest';
args = args,
console = "integratedTerminal",
-- program = "${file}";
}
-- session = dap.launch(adapter, config)
dap.run(config)
-- List of events described at https://microsoft.github.io/debug-adapter-protocol/specification#Events
-- Also see :h dap-extensions
dap.listeners.after["event_initialized"]["pytest.lua"] = function (_, _)
dap.set_exception_breakpoints({ "userUnhandled", })
end
end
return M