phildorado
Change mix run command to task for Debugging
Elixir noob here and apologies in advance if this has already been answered/is really stupid.
Trying to debug open source project strobe audio. https://github.com/strobe-audio:
mix run -e “Peel.scan()” from the command line works.
I’m trying to move this into a mix task so I can use the debugger in VS Code. I can call this function from the task, but it appears the application is not running as I get an error “Peel.Repo is not started, please ensure it is part of your supervision tree”. How can I build the application the same way that mix run does, but from a task? Thanks in advance.
Most Liked
easco
Look in the documentation here:
In the section about Aliases. You should be able to create an alias for your mix run command, I believe.
JakeBecker
run is already a Mix task. Try setting your debug config to something like this:
{
"type": "mix_task",
"name": "Peel.scan/0",
"request": "launch",
"task": "run",
"taskArgs": ["-e", "Peel.scan()"],
"projectDir": "${workspaceRoot}"
}








