Debugger for Console
Quickly create console debugging information for multiple languages.
BREAKING CHANGE
Starting from 0.11.0, replace the placeholder variable with {VALUE} instead of $.
Features
- Quickly create console debugging information for multiple languages.
- Support for custom debugging statements for different languages.
- Support for inserting debugging statements before and after the current line.
- Support for removing all debugging statements in the document.
- Support for commenting and uncommenting all debugging statements in the document.
- Support for inserting debugging statements in multiple cursors.
- Supports merging multiple cursors in the same row.
- Support for updating the latest workbench configuration.
Installing
This extension is available for free in the Visual Studio Code Marketplace.
Usage
keybindings
Create the statement before the line
ctrl + shift + ↑(ArrowUp)
Create the statement after the line
ctrl + shift + ↓(ArrowDown)
Remove all statements on document
ctrl + shift + ←(Backspace)
ctrl + shift + /
ctrl + shift + u
Multi cursor
merge multi cursor in the same row:
multi line cursors:
command
> debugger-for-console.create
: Insert a debug statement after it
> debugger-for-console.before
: Insert a debug statement before it
> debugger-for-console.remove
: Remove all debugger statements
> debugger-for-console.comment
: Comment all debugger statements
> debugger-for-console.uncomment
: Uncomment all debugger statements
> debugger-for-console.update
: Update latest workbench configuration. (This way, your modifications can take effect immediately without restarting your editor.)
Configuration
You can customize the statements you want to insert in the Settings.(You can also use this plugin as a simple code snippet)
TIPS: The key of javascript
| typescript
| javascriptreact
| typescriptreact
| vue
| svelte
is JavaScript.
// preset
{
// Save the current file after performing the operation
"debugger-for-console.autoSave": false,
// What kind of quotation marks to use when inserting statements
// Some languages that enforce the use of double quotes may not be valid, e.g. go
"debugger-for-console.quote": "'",
// Whether to insert emoji
"debugger-for-console.emoji": true,
// Relative path depth of files
"debugger-for-console.fileDepth": 2,
// Whether to insert the line number
"debugger-for-console.lineNumber": true,
// Insert the scope symbols in the debug statement.
"debugger-for-console.symbols": false,
// Customize debugging statements for different languages
"debugger-for-console.wrappers": {
"php": "var_dump({VALUE})",
"python": "print({VALUE})",
"rust": "println!({VALUE})",
"go": "println({VALUE})",
"csharp": "Console.Log({VALUE})",
"javascript": "console.log({VALUE})",
"default": "console.log({VALUE})"
}
}
examples
{
"debugger-for-console.wrappers": {
"javascript": "console.warn({VALUE})"
// OR
// "javascript": "debugger"
// "javascript": "print({VALUE})"
}
}