This commit is contained in:
ViViDboarder 2023-12-08 11:43:05 -08:00
parent b3f73d92dc
commit abe6a88fa7
3 changed files with 75 additions and 1 deletions

View File

@ -216,12 +216,21 @@ function install_fixers() {
echo "" echo ""
} }
## Debuggers
function install_debuggers() {
# Python
if want_lang python ;then
maybe_run pip3 install --user --upgrade debugpy
fi
}
function main() { function main() {
maybe_run pip3 install --user --upgrade release-gitter maybe_run pip3 install --user --upgrade release-gitter
install_language_servers install_language_servers
install_linters install_linters
install_fixers install_fixers
install_debuggers
echo "" echo ""
echo "DONE" echo "DONE"

View File

@ -243,6 +243,61 @@ use({
}), }),
}) })
-- Debug adapter protocol
use({
"https://github.com/mfussenegger/nvim-dap",
-- TODO: Move to lazy.nvim and allow it to load this only when the required debuggers are loaded
ft = { "python", "rust" },
})
use({
"https://github.com/rcarriga/nvim-dap-ui",
requires = { "https://github.com/mfussenegger/nvim-dap" },
after = "nvim-dap",
config = function()
require("dapui").setup({
icons = {
expanded = "-",
collapsed = "+",
current_frame = ">",
},
controls = {
icons = {
disconnect = "disconnect",
pause = "pause",
play = "play",
run_last = "last",
step_back = "back",
step_into = "into",
step_out = "out",
step_over = "over",
terminate = "term",
},
},
})
local dap, dapui = require("dap"), require("dapui")
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
end,
})
use({
"https://github.com/mfussenegger/nvim-dap-python",
requires = { "https://github.com/mfussenegger/nvim-dap" },
after = "nvim-dap",
config = function()
require("dap-python").setup()
end,
ft = "python",
})
-- Install language servers -- Install language servers
use({ use({
"https://github.com/williamboman/mason.nvim", "https://github.com/williamboman/mason.nvim",
@ -263,7 +318,12 @@ use({
-- Rust analyzer -- Rust analyzer
use({ use({
"https://github.com/simrat39/rust-tools.nvim", "https://github.com/simrat39/rust-tools.nvim",
after = "nvim-dap",
disable = vim.fn.has("nvim-0.7.0") ~= 1, disable = vim.fn.has("nvim-0.7.0") ~= 1,
-- TODO: After switching to lazy, with better dependency ordering, can remove the after
config = function()
require("dap")
end,
}) })
-- Better display of lsp diagnostics -- Better display of lsp diagnostics

View File

@ -331,7 +331,12 @@ function M.config_lsp()
-- Configure neovim dev for when sumneko_lua is installed -- Configure neovim dev for when sumneko_lua is installed
utils.try_require("neodev", function(neodev) utils.try_require("neodev", function(neodev)
neodev.setup({}) local config = {}
if utils.can_require("dapui") then
config.plugins = { "nvim-dap-ui" }
config.types = true
end
neodev.setup(config)
end) end)
-- Auto setup mason installed servers -- Auto setup mason installed servers