openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

Generate debugging launch.json for all openpilot processes

Open jakethesnake420 opened this issue 1 year ago • 1 comments

Run tools/vscode_debug/generate_vscode_debug_launch.py to automatically populate the launch.json file with all the openpilot processes. It also supports default arguments for debugging and environment variables. Generating does not delete your existing launch.json, it will rename it.

image image image

jakethesnake420 avatar Jan 28 '24 07:01 jakethesnake420

It looks like you didn't use one of the Pull Request templates. Please check the contributing docs. Also make sure that you didn't modify any of the checkboxes or headings within the template.

github-actions[bot] avatar Jan 28 '24 07:01 github-actions[bot]

I don't use VSCode but this seems useful for those who do. However, this is way too many lines, and seems to require the user knows about this and runs it?

Is there a way for VSCode to generate these automatically if you open the project?

adeebshihadeh avatar Feb 02 '24 19:02 adeebshihadeh

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "inputs": [
        {
          "id": "python_process",
          "type": "pickString",
          "description": "Select the process to debug",
          "options": [
            "selfdrive/controls/controlsd.py",
            "system/timed/timed.py"
          ],
        },
        {
          "id": "args",
          "description": "Arguments to pass to the process",
          "type": "promptString"
        }
    ],
    "configurations": [
        {
            "name": "Python: Openpilot Process",
            "type": "debugpy",
            "request": "launch",
            "program": "${input:python_process}",
            "console": "integratedTerminal",
            "justMyCode": true,
            "args": "${input:args}"
        }
    ]
}

something like this would be simpler

jnewb1 avatar Feb 02 '24 19:02 jnewb1

I don't use VSCode but this seems useful for those who do.

I'm curious. It's there a standard ide setup that comma employees use?

jakethesnake420 avatar Feb 04 '24 00:02 jakethesnake420

I'm curious. It's there a standard ide setup that comma employees use?

no, everyone can use their own preferred ide. though we would like to make vscode a decent experience since we support devcontainers

jnewb1 avatar Feb 05 '24 20:02 jnewb1

I think trying to copy the setup from the main vscode repo here would make sense. They have the vscode folder checked in with launch configs that work with their devcontainer. If we can do something like it suggested above in this comment where we have 1 config for cpp and 1 for python that would be ideal. https://github.com/commaai/openpilot/pull/31197#issuecomment-1924539753.

jnewb1 avatar Feb 05 '24 21:02 jnewb1

Closing, feel free to open a cleaner version of this.

adeebshihadeh avatar Feb 09 '24 19:02 adeebshihadeh