ASK Mode
Why We Need 🟢 ASK Mode
The ASK mode is your primary tool for quick, targeted interactions with the AI that don't require modifying your existing files directly.
Think of it as a conversational partner or an infinitely patient senior developer you can consult at any moment.
It's designed for speed and safety, ensuring the AI provides information and code without making unintended changes.
✨ This mode is perfect for:
- Understanding Code: Quickly get a plain-English explanation of a complex function, a regular expression, or a confusing algorithm.
- Generating Standalone Snippets: Create a new helper function, a class, a configuration object, or a test case based on a prompt.
- Brainstorming & Alternatives: Ask for different ways to approach a problem or inquire about best practices for a specific scenario.
- Quick Fixes: Paste a small block of buggy code and ask the AI to fix it. You can then review the suggested fix in the chat and apply it yourself.
💡 Essentially, use ASK mode whenever your request is self-contained and you want to maintain full, manual control over applying any generated code.
⚙️ How It Works
The workflow is simple and non-invasive.
1️⃣ Context
You can either highlight a specific piece of code to provide direct context or simply place your cursor where you might want to add new code.
2️⃣ Prompt
You open the AI chat panel and type your question or request.
3️⃣ Response
The AI uses the context of your currently open file and any highlighted code to generate a response exclusively within the chat panel.
🚫 Your source files are never modified.
👉 You are responsible for copying, pasting, and integrating the AI's response into your codebase.
💻 Example: Generating a Utility Function
Let's say you need a JavaScript function to format a date object into a YYYY-MM-DD string.
- In your
utils.jsfile, you find a good spot for the new function. - The AI will respond in the chat with the complete function:
Open the chat and use ASK mode with the prompt:
"Write a JavaScript function called formatDateISO that takes a Date object and returns it as a 'YYYY-MM-DD' formatted string."function formatDateISO(date) {
if (!(date instanceof Date) || isNaN(date)) {
return null; // or throw an error, or return a default string
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
- You can then copy this code from the chat window and paste it directly into your file.
🎥 Working with the Ask Mode examples
Example 1:
Example 2:
Member discussion