Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Request: VSCode Debugging #738

Open
NateLedet opened this issue Sep 13, 2024 · 0 comments
Open

Documentation Request: VSCode Debugging #738

NateLedet opened this issue Sep 13, 2024 · 0 comments

Comments

@NateLedet
Copy link

VSCode Debugging setup

Request

Documentation Addition:
Set up debugging in VSCode for a Cement based CLI tool.

System Information

  • Cement Version: 3.x
  • Python Version: 3.x
  • Operating System and Version: Windows 11 (not yet tested on Linux/MacOS)

Steps to Implement

  • Create or Modify launch.json
    • Run > Open Configurations
    • Run > Add Configurations
      • Select Python Debugger > Module > project_name.main (ie: todo.main)

Modify the configuration code block to allow for arguments/options:

launch.json

"configurations": [
  {
    "name": "Python Debugger: Cement CLI Tool",
    "type": "debugpy",
    "request": "launch",
    "module": "todo.main"
    "console": "integratedTerminal",
    "args": "${command:pickArgs}"
  }
]

The above configuration will prompt for arguments/options when Debug runs. An alternative to is to hard-code the args/options if you're frequently debugging a specific piece of your code:

    "args": [ "list", "-h" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant