2023-01-17 15:05:13 +01:00
|
|
|
local M = {
|
|
|
|
'jay-babu/mason-nvim-dap.nvim',
|
|
|
|
dependencies = {
|
|
|
|
'williamboman/mason.nvim',
|
|
|
|
'mfussenegger/nvim-dap',
|
|
|
|
},
|
|
|
|
cmd = { 'DapInstall', 'DapUninstall' },
|
|
|
|
}
|
|
|
|
|
|
|
|
function M.config()
|
2023-01-23 18:57:39 +01:00
|
|
|
local dap = require 'dap'
|
2023-01-17 15:05:13 +01:00
|
|
|
require('mason-nvim-dap').setup {
|
|
|
|
automatic_setup = true,
|
|
|
|
}
|
2023-01-23 18:57:39 +01:00
|
|
|
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,
|
|
|
|
}
|
2023-01-17 15:05:13 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|