aboutsummaryrefslogtreecommitdiffstats
path: root/lua/pi/dap/configs/elixir.lua
blob: bf732ce411fe1f03b299c74bc7e5d0bd07f81301 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
local dap = require('dap')

dap.adapters.mix_task = {
  type = 'executable',
  command = 'elixir-ls-debugger',  -- El comando 'elixir-ls' está en $PATH
  args = {}
}

dap.configurations.elixir = {
  {
    type = "mix_task",
    name = "mix (Default task)",
    request = "launch",
    projectDir = "${workspaceRoot}"
  },
  {
    type = "mix_task",
    name = "mix test",
    request = "launch",
    task = 'test',
    env = {
      MIX_ENV = "test",
      MIX_TARGET = "host",
      HEX_UNSAFE_HTTPS = 1
    },
    taskArgs = {"--trace"},
    startApps = true, -- for Phoenix projects
    projectDir = "${workspaceFolder}",
    requireFiles = {
      "test/**/test_helper.exs",
      "test/**/*_test.exs"
    }
  },
  {
    type = "mix_task",
    name = "phx server",
    request = "launch",
    stackTraceMode = "all",
    task = 'phx.server',
    debugAutoInterpretAllModules = true,
    noDebug = false,
    exitAfterTaskReturns = false,
    env = {
      MIX_ENV = "dev",
      MIX_TARGET = "host",
      HEX_UNSAFE_HTTPS = 1
    },
    startApps = false, -- for Phoenix projects
    taskArgs = {"--no-halt", "--open"},
    projectDir = "${workspaceFolder}",
  },
}