stylua and removal mason reliance

This commit is contained in:
2026-04-11 22:36:03 +02:00
parent b9f92d6ba4
commit b0cbc702cf
29 changed files with 480 additions and 443 deletions
+39 -41
View File
@@ -1,32 +1,31 @@
local dap = require('dap')
local dap = require "dap"
dap.adapters.python = function(cb, config)
if config.request == 'attach' then
if config.request == "attach" then
---@diagnostic disable-next-line: undefined-field
local port = (config.connect or config).port
---@diagnostic disable-next-line: undefined-field
local host = (config.connect or config).host or '127.0.0.1'
cb({
type = 'server',
port = assert(port,
'`connect.port` is required for a python `attach` configuration'),
local host = (config.connect or config).host or "127.0.0.1"
cb {
type = "server",
port = assert(port, "`connect.port` is required for a python `attach` configuration"),
host = host,
options = {source_filetype = 'python'}
})
options = { source_filetype = "python" },
}
else
cb({
type = 'executable',
command = 'path/to/virtualenvs/debugpy/bin/python',
args = {'-m', 'debugpy.adapter'},
options = {source_filetype = 'python'}
})
cb {
type = "executable",
command = "path/to/virtualenvs/debugpy/bin/python",
args = { "-m", "debugpy.adapter" },
options = { source_filetype = "python" },
}
end
end
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`
request = 'launch',
type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python`
request = "launch",
name = "Launch file",
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
@@ -37,35 +36,34 @@ dap.configurations.python = {
-- 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()
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'
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 '/home/zach/miniconda3/bin/python'
return "/home/zach/miniconda3/bin/python"
end
end
}
end,
},
}
dap.adapters.lldb = {
type = 'executable',
command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path
name = 'lldb'
type = "executable",
command = "/usr/bin/lldb-vscode", -- adjust as needed, must be absolute path
name = "lldb",
}
dap.configurations.cpp = {
{
name = 'Launch',
type = 'lldb',
request = 'launch',
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}',
cwd = "${workspaceFolder}",
stopOnEntry = false,
args = {}
args = {},
-- 💀
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
@@ -79,7 +77,7 @@ dap.configurations.cpp = {
-- But you should be aware of the implications:
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
-- runInTerminal = false,
}
},
}
dap.adapters["pwa-node"] = {
@@ -91,9 +89,9 @@ dap.adapters["pwa-node"] = {
-- 💀 Make sure to update this path to point to your installation
args = {
"%HOME/.config/nvim/java-dap/js-debug/src/dapDebugServer.js",
"${port}"
}
}
"${port}",
},
},
}
dap.configurations.javascript = {
@@ -102,10 +100,10 @@ dap.configurations.javascript = {
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}"
}
cwd = "${workspaceFolder}",
},
}
dap.configurations.java = {
{type = "java", name = "Debug", request = "launch", program = "${file}"}
{ type = "java", name = "Debug", request = "launch", program = "${file}" },
}