Skip to content

Instantly share code, notes, and snippets.

@IliasDeros
Last active June 17, 2022 01:18
Show Gist options
  • Save IliasDeros/58c73cad263468ec27b20005843f4b3b to your computer and use it in GitHub Desktop.
Save IliasDeros/58c73cad263468ec27b20005843f4b3b to your computer and use it in GitHub Desktop.
A Ruby on Rails + React developer's common VSCode debug configurations
{
"version": "0.2.0",
"configurations": [
{
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/bin/rails",
"args": [
"server"
],
"useBundler": true,
"pathToBundler": "${workspaceRoot}/bin/bundle",
"env": {
"WEB_CONCURRENCY": 0
}
},
{
"name": "Rspec",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"useBundler": true,
"debuggerPort": "1235",
"pathToBundler": "${workspaceRoot}/bin/bundle",
"program": "${workspaceRoot}/bin/rspec",
"args": [
"${file}"
],
"env": {
"DISABLE_SPRING": 1
}
},
{
"type": "node",
"request": "launch",
"name": "Jest Test",
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
"args": ["--ci", "${file}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"sourceMaps": true
}
]
}
@IliasDeros
Copy link
Author

Source for "WEB_CONCURRENCY": 0 - rubyide/vscode-ruby#426. Without it, the code may stop on a breakpoint while VSCode is listening to the debugger on a different thread, hanging the server without handling the breakpoint correctly in the IDE. Thank you @jonmchan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment