Skip to content

VS Code extension to catch variables in debug runtime, create prompt for unit and regression tests

License

Notifications You must be signed in to change notification settings

Codecta/test_snap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debug Catch: Copy Variables From Stack

Copy entry parameters and local variables from the current stack frame while debugging, directly from a hover on a function/method.

  • Hover during debug: Move the cursor over a function/method while a debug session is paused to see action links.
  • Copy all variables: Copies arguments and locals as JSON to your clipboard.
  • Copy entry params: Copies only the method/function parameters as JSON to your clipboard.

Requirements

  • VS Code ^1.83.0
  • A running debug session paused at a breakpoint (the extension works only when stopped in the debugger)

Usage

  1. Start debugging and pause on a breakpoint.
  2. Place the cursor on a function/method name.
  3. In the hover, click:
    • Copy all variables to copy arguments + locals
    • Copy entry params to copy only arguments
  4. Paste the JSON into your unit tests.

You can also run commands from the Command Palette:

  • Debug Catch: Copy All Variables For Current Method
  • Debug Catch: Copy Entry Parameters For Current Method

Settings

These settings control expansion depth and total items fetched from the debug adapter.

  • debugCatch.maxExpandDepth (number, default 2): How deep to recursively expand complex objects.
  • debugCatch.maxItems (number, default 200): Soft cap for number of variables/items expanded.

Note: Scopes are adapter-specific. This extension looks for scopes containing "args" for parameters and typical local scopes for variables.

Limitations

  • Actual variable names/scopes depend on the active debug adapter and language.
  • Complex values are serialized best-effort via the debug adapter string values. Some adapters may truncate or format values differently.
  • Very deep or very large objects are truncated using the settings above.

Development

  • Open this folder in VS Code.
  • Press F5 to run the extension in a new Extension Development Host.
  • Set breakpoints in extension.js for debugging the extension itself.

License

MIT

About

VS Code extension to catch variables in debug runtime, create prompt for unit and regression tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published