nvim/lua/plugins/mason-nvim-dap.lua

48 lines
1.1 KiB
Lua

local M = {
'jay-babu/mason-nvim-dap.nvim',
dependencies = {
'williamboman/mason.nvim',
'mfussenegger/nvim-dap',
},
cmd = { 'DapInstall', 'DapUninstall' },
}
function M.config()
local dap = require 'dap'
require('mason-nvim-dap').setup {
automatic_setup = true,
}
require('mason-nvim-dap').setup_handlers {
function(source_name)
-- all sources with no handler get passed here
-- Keep original functionality of `automatic_setup = true`
require 'mason-nvim-dap.automatic_setup'(source_name)
end,
elixir = function(source_name)
dap.adapters.mix_task = {
type = 'executable',
command = '/home/user/.local/share/nvim/mason/packages/elixir-ls/debugger.sh', -- debugger.bat for windows
args = {},
}
dap.configurations.elixir = {
{
type = 'mix_task',
name = 'mix test',
task = 'test',
taskArgs = { '--trace' },
request = 'launch',
startApps = true, -- for Phoenix projects
projectDir = '${workspaceFolder}',
requireFiles = {
'test/**/test_helper.exs',
'test/**/*_test.exs',
},
},
}
end,
}
end
return M