Quick Actions provide instant transformations for selected text or code. With a single click, apply expert-level operations like code explanation, optimization, translation, summarization, and more.
What it does: Provides clear, educational explanations of code
// From: src/data/templates.ts - Quick ActionsSystemPrompt: ` Programming educator with expertise in multiple languages. Explain code covering: 1. What it does (function/purpose) 2. How it works (step-by-step breakdown) 3. Why it's written this way (design decisions) 4. Key concepts (patterns, algorithms, features) 5. Potential improvements or alternatives Use analogies and provide practical examples.`
Example Usage:
// Select this code and click "Explain Code"const fibonacci = (n) => { if (n <= 1) return n; return fibonacci(n - 1) + fibonacci(n - 2);};
What it does: Generates comprehensive code documentationDocumentation Types:
JavaScript/TypeScript
Python
Java
/** * Calculates the total price including tax * @param {number} price - Base price before tax * @param {number} taxRate - Tax rate as decimal (e.g., 0.08 for 8%) * @returns {number} Total price with tax applied * @throws {Error} If price is negative or taxRate is invalid * @example * calculateTotal(100, 0.08) // Returns 108 */function calculateTotal(price: number, taxRate: number): number { // Validate inputs to prevent calculation errors if (price < 0) throw new Error('Price cannot be negative'); if (taxRate < 0 || taxRate > 1) throw new Error('Invalid tax rate'); // Calculate tax amount and add to base price const tax = price * taxRate; return price + tax;}
def calculate_total(price: float, tax_rate: float) -> float: """ Calculate the total price including tax. Args: price (float): Base price before tax tax_rate (float): Tax rate as decimal (e.g., 0.08 for 8%) Returns: float: Total price with tax applied Raises: ValueError: If price is negative or tax_rate is invalid Examples: >>> calculate_total(100, 0.08) 108.0 >>> calculate_total(50.00, 0.10) 55.0 """ # Validate inputs to prevent calculation errors if price < 0: raise ValueError("Price cannot be negative") if not 0 <= tax_rate <= 1: raise ValueError("Tax rate must be between 0 and 1") # Calculate tax amount and add to base price tax = price * tax_rate return price + tax
/** * Calculates the total price including tax. * * <p>This method applies the specified tax rate to the base price * and returns the total amount. Input validation ensures that * the price is non-negative and the tax rate is within valid bounds.</p> * * @param price The base price before tax (must be non-negative) * @param taxRate The tax rate as a decimal between 0 and 1 * @return The total price with tax applied * @throws IllegalArgumentException if price is negative or taxRate is invalid * * @example * <pre> * double total = calculateTotal(100.0, 0.08); * // total = 108.0 * </pre> */public double calculateTotal(double price, double taxRate) { // Validate inputs to prevent calculation errors if (price < 0) { throw new IllegalArgumentException("Price cannot be negative"); } if (taxRate < 0 || taxRate > 1) { throw new IllegalArgumentException("Invalid tax rate"); } // Calculate tax amount and add to base price double tax = price * taxRate; return price + tax;}
What it does: Professional translation with cultural contextFeatures:
Preserves original meaning and intent
Adapts idioms and cultural references
Maintains appropriate tone and formality
Handles technical terminology correctly
Considers regional variations
Usage Example:
Original (English):"Let's touch base next week to circle back on this."Translation (French - Professional):"Reprenons contact la semaine prochaine pour faire le point."Note: Avoided literal translation of "touch base" and "circle back"which don't translate well. Used professional equivalents.
What it does: Creates concise summaries with key pointsOutput Structure:
## Key Points- Main idea 1 (most important)- Main idea 2 - Main idea 3## Supporting Details- Critical detail 1- Critical detail 2## Conclusions- Primary conclusion- Action items (if applicable)
What it does: Enhances clarity, style, and impactImprovements Include:
Clarity
Remove ambiguous phrasing
Simplify complex sentences
Eliminate redundancy
Strengthen topic sentences
Style
Consistent voice and tone
Better word choice
Varied sentence structure
Active voice preference
Grammar
Fix grammatical errors
Correct punctuation
Proper tense consistency
Subject-verb agreement
Impact
Stronger opening and closing
More persuasive language
Better flow and transitions
Enhanced readability
Example:
- Original: "The thing that we want to do is make our product better so that people will want to use it more."+ Improved: "We aim to enhance our product to increase user engagement and satisfaction." Changes: - Removed filler ("the thing that") - Used stronger verbs ("enhance" vs "make better") - More professional tone - Clearer, more direct statement
What it does: Makes complex text accessibleTechniques:
Replace jargon with plain language
Break down complex concepts
Use active voice
Shorten sentences (aim for 15-20 words)
Add examples and analogies
Before/After Example:
The implementation of a comprehensive algorithmic approach to data processing necessitates the utilization of advanced computational methodologies that facilitate the optimization of resource allocation while simultaneously minimizing latency-induced performance degradation.