快速打印变量成日志
Access rate limit exceeded. Please log in to continue.
Turbo Print Var
🚀 Main Features
Turbo Print Var is a powerful VS Code extension that automates debug log insertion for 20+ programming languages. It intelligently generates context-aware log statements with file names, line numbers, and variable information.
✨ Key Highlights
- 🌍 Multi-Language Support: JavaScript/TypeScript, Python, Java, C/C++, Go, Rust, PHP, Ruby, Swift, Kotlin, Scala, and more
- 🎯 Smart Variable Detection: Automatically detects variables at cursor position or selection
- 📍 Context-Aware: Includes file name and line number in log output
- ⚡ Multi-Cursor Support: Process multiple variables simultaneously
- 🎨 Customizable Format: Configure log prefix, delimiter, quotes, and more
- 🔧 Powerful Commands: Insert, update, comment, uncomment, and delete logs
📖 Usage
1. Insert Log Statement
- Select a variable or place cursor on it
- Press
Ctrl+Alt+L(Windows/Linux) orCmd+Alt+L(Mac) - Log statement will be inserted on the next line
Example Output:
const user = { name: 'John' };
console.log('🚀 ~ file: app.js:2 ~ user:', user);
2. Update Line Numbers
- Press
Ctrl+Alt+U(Windows/Linux) orCmd+Alt+U(Mac) - Updates line numbers in all log statements
3. Comment/Uncomment Logs
- Comment:
Alt+Shift+C - Uncomment:
Alt+Shift+U
4. Delete All Logs
- Press
Alt+Shift+Dto remove all generated log statements
⚙️ Configuration
Customize the extension in VS Code settings (Ctrl+, or Cmd+,):
| Setting | Description | Default |
|---|---|---|
turbo-print-var.prefix |
Prefix symbol for log messages | 🚀 |
turbo-print-var.suffix |
Suffix after variable name | : |
turbo-print-var.separator |
Delimiter between log elements | ~ |
turbo-print-var.quote |
Quote style: ", ', or ` |
" |
turbo-print-var.includeFileInfo |
Include file name and line number | true |
turbo-print-var.addSemicolon |
Add semicolon at end (auto-detect if unset) | auto |
turbo-print-var.emptyLineBefore |
Insert empty line before log | false |
turbo-print-var.emptyLineAfter |
Insert empty line after log | false |
turbo-print-var.logFunction |
Custom log function per language | {} |
Example custom log function:
{
"turbo-print-var.logFunction": {
"php": "var_dump",
"python": "print"
}
}
🌐 Supported Languages
- C
- C++
- C#
- CoffeeScript
- Dart
- Go
- Groovy
- Java
- JavaScript
- Kotlin
- Lua
- Perl
- PHP
- Python
- R
- Ruby
- Rust
- Scala
- Shell Script
- Swift
- TypeScript
📝 License
MIT