From e29047af3b56bb47ca269831fadd2bb8f48ec513 Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Wed, 3 Apr 2024 21:51:16 +0200 Subject: [PATCH] fixes for dap stuff --- Containerfile | 8 +++----- lua/lazy-load.lua | 4 ++++ lua/plugins/neodev.lua | 7 +++++++ lua/plugins/nvim-dap.lua | 22 ++++++++++++---------- 4 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 lua/plugins/neodev.lua diff --git a/Containerfile b/Containerfile index 2ff3bdb..3f965bb 100644 --- a/Containerfile +++ b/Containerfile @@ -23,9 +23,7 @@ ENV GENERAL_PKGS="\ fzf \ tar" -ENV PYTHON_DEVEL_PKGS="python3 python3-pip" - -ENV PIP_PKGS="debugpy" +ENV PYTHON_DEVEL_PKGS="python3" ENV BUILD_ONLY_PKGS="python3-devel" @@ -49,7 +47,8 @@ ENV MASON_PKGS=" \ yaml-language-server \ markdownlint \ ansible-language-server \ - ansible-lint" + ansible-lint \ + debugpy" ENV MASON_PKGS_NO_ARM="lemminx helm-ls" @@ -58,7 +57,6 @@ COPY . /root/.config/nvim # install system dependencies RUN dnf5 install -y \ ${GENERAL_PKGS} ${NEOVIM_PKGS} ${PYTHON_DEVEL_PKGS} ${BUILD_ONLY_PKGS} && \ - pip install ${PIP_PKGS} && \ dnf5 remove -y ${BUILD_ONLY_PKGS} && \ dnf5 -y autoremove && \ dnf5 clean all && \ diff --git a/lua/lazy-load.lua b/lua/lazy-load.lua index 07df3b4..6ab0869 100644 --- a/lua/lazy-load.lua +++ b/lua/lazy-load.lua @@ -34,6 +34,10 @@ require("lazy").setup({ dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio", "theHamsta/nvim-dap-virtual-text" }, config = require('plugins.nvim-dap').init }, + { + "folke/neodev.nvim", + config = require('plugins.neodev').init + }, { 'hrsh7th/cmp-nvim-lsp' }, { 'hrsh7th/cmp-buffer' }, { 'hrsh7th/cmp-cmdline' }, diff --git a/lua/plugins/neodev.lua b/lua/plugins/neodev.lua new file mode 100644 index 0000000..8185848 --- /dev/null +++ b/lua/plugins/neodev.lua @@ -0,0 +1,7 @@ +return { + init = function() + require("neodev").setup({ + library = { plugins = { "nvim-dap-ui" }, types = true }, + }) + end +} diff --git a/lua/plugins/nvim-dap.lua b/lua/plugins/nvim-dap.lua index 76590ad..f524913 100644 --- a/lua/plugins/nvim-dap.lua +++ b/lua/plugins/nvim-dap.lua @@ -23,6 +23,8 @@ return { -- setup dapui local dapui = require("dapui") + dapui.setup() + dap.listeners.before.attach.dapui_config = function() dapui.open() end @@ -38,15 +40,15 @@ return { -- setup dap virtual text require("nvim-dap-virtual-text").setup { - enabled = true, -- enable this plugin (the default) - enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination) + enabled = true, -- enable this plugin (the default) + enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination) highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText - highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables) - show_stop_reason = true, -- show stop reason when stopped for exceptions - commented = false, -- prefix virtual text with comment string - only_first_definition = true, -- only show virtual text at first definition (if there are multiple) - all_references = false, -- show virtual text on all all references of the variable (not only definitions) - clear_on_continue = false, -- clear virtual text on "continue" (might cause flickering when stepping) + highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables) + show_stop_reason = true, -- show stop reason when stopped for exceptions + commented = false, -- prefix virtual text with comment string + only_first_definition = true, -- only show virtual text at first definition (if there are multiple) + all_references = false, -- show virtual text on all all references of the variable (not only definitions) + clear_on_continue = false, -- clear virtual text on "continue" (might cause flickering when stepping) --- A callback that determines how a variable is displayed or whether it should be omitted --- @param variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable --- @param buf number @@ -65,8 +67,8 @@ return { virt_text_pos = vim.fn.has 'nvim-0.10' == 1 and 'inline' or 'eol', -- experimental features: - all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine. - virt_lines = false, -- show virtual lines instead of virtual text (will flicker!) + all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine. + virt_lines = false, -- show virtual lines instead of virtual text (will flicker!) virt_text_win_col = nil -- position the virtual text at a fixed window column (starting from the first text column) , -- e.g. 80 to position at column 80, see `:h nvim_buf_set_extmark()` }