Skip to content

Commit

Permalink
feat(elixir): support automate_setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-babu committed Dec 8, 2022
1 parent 8972195 commit cb4a353
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lua/mason-nvim-dap/mappings/adapters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ if vim.fn.has('win32') == 1 then
}
end

M.mix_task = {
type = 'executable',
command = 'elixir-ls-debugger', -- https://github.com/williamboman/mason.nvim/blob/d97579ccd5689f9c6c365e841ea99c27954112ec/lua/mason-registry/elixir-ls/init.lua#L26
args = {},
}

M = vim.tbl_deep_extend('force', M, settings.current.automatic_setup.adapters or {})

return M
18 changes: 17 additions & 1 deletion lua/mason-nvim-dap/mappings/configurations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ M.delve = {
}

local BASHDB_DIR = require('mason-registry').get_package('bash-debug-adapter'):get_install_path()
.. '/extension/bashdb_dir'
.. '/extension/bashdb_dir'
M.bash = {
{
type = 'bash',
Expand Down Expand Up @@ -164,6 +164,22 @@ M.cppdbg = {
},
}

M.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',
},
},
}

M = vim.tbl_deep_extend('force', M, settings.current.automatic_setup.configurations or {})

return M
1 change: 1 addition & 0 deletions lua/mason-nvim-dap/mappings/filetypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ M.adapter_to_configs = {
['php'] = { 'php' },
['python'] = { 'python' },
['cppdbg'] = { 'c', 'cpp', 'rust' },
['mix_task'] = { 'elixir' },
}

return M

0 comments on commit cb4a353

Please sign in to comment.