Merge pull request #1 from fernandom06/config-python-dap

Config python dap
This commit is contained in:
Fernando Muñoz Paredes 2024-04-30 00:31:20 +02:00 committed by GitHub
commit 6db2657739
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View File

@ -558,6 +558,7 @@ require('lazy').setup({
-- clangd = {}, -- clangd = {},
-- gopls = {}, -- gopls = {},
pyright = {}, pyright = {},
ruff = {},
taplo = {}, -- LSP for toml files taplo = {}, -- LSP for toml files
-- rust_analyzer = {}, -- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
@ -721,6 +722,7 @@ require('lazy').setup({
-- This will auto-import if your LSP supports it. -- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet. -- This will expand snippets if the LSP sent a snippet.
['<C-y>'] = cmp.mapping.confirm { select = true }, ['<C-y>'] = cmp.mapping.confirm { select = true },
['<CR>'] = cmp.mapping.confirm { select = true },
-- Manually trigger a completion from nvim-cmp. -- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display -- Generally you don't need this, because nvim-cmp will display

View File

@ -2,6 +2,7 @@ return {
'linux-cultist/venv-selector.nvim', 'linux-cultist/venv-selector.nvim',
dependencies = { 'neovim/nvim-lspconfig', 'nvim-telescope/telescope.nvim', 'mfussenegger/nvim-dap-python' }, dependencies = { 'neovim/nvim-lspconfig', 'nvim-telescope/telescope.nvim', 'mfussenegger/nvim-dap-python' },
opts = { opts = {
dap_enabled = true, -- makes the debugger work with venv
-- Your options go here -- Your options go here
-- name = "venv", -- name = "venv",
-- auto_refresh = false -- auto_refresh = false

View File

@ -23,6 +23,7 @@ return {
-- Add your own debuggers here -- Add your own debuggers here
'leoluz/nvim-dap-go', 'leoluz/nvim-dap-go',
'mfussenegger/nvim-dap-python'
}, },
config = function() config = function()
local dap = require 'dap' local dap = require 'dap'
@ -42,6 +43,7 @@ return {
ensure_installed = { ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want -- Update this to ensure that you have the debuggers for the langs you want
'delve', 'delve',
'debugpy'
}, },
} }
@ -83,8 +85,10 @@ return {
dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close
local debugpyPythonPath = require("mason-registry").get_package("debugpy"):get_install_path() .. "/venv/bin/python3"
-- Install golang specific config -- Install golang specific config
require('dap-go').setup() require('dap-go').setup()
require("dap-python").setup(debugpyPythonPath, {})
end, end,
} }