Ask Mode is designed for natural language interaction with your codebase. It's ideal for asking coding questions, understanding your project, and exploring technology concepts — all without modifying your code.
🔧 Prerequisites
-
✅ Visual Studio Code (latest version)
-
✅ GitHub Copilot Access (Free plan includes limited chat usage)
💡 Why Use Ask Mode?
Use Ask Mode for:
Task Type | Example |
---|---|
🧠 Understanding code | "Where is the database connection string defined?" |
💭 Brainstorming | "What are 3 ways to implement caching?" |
💻 Coding help | "How do I create a new React component?" |
📚 Learning concepts | "Explain the factory design pattern" |
📝 Responses often include code blocks, terminal commands, or symbol references.
🚀 How to Use Ask Mode
-
Open Chat View
-
Ctrl+Alt+I
(Windows/Linux) -
Use command: “Open Chat”
-
-
Select Ask Mode
-
Choose "Ask" from the dropdown next to the input box
-
-
Type a Question
-
Example:
"How do I fetch data with Axios in React?"
-
-
Send your question
-
Press Enter or click Send
-
🧱 Add Context for Smarter Answers
Use #-mentions
Attach files, folders, symbols, or context variables:
➡️ Type #
in the chat box to browse available items
Use @-mentions
Refer to built-in participants (like experts):
Use /slash
Commands
Trigger specific tasks:
-
/explain
– Explains selected code -
/fix
– Proposes a fix for an issue -
/test
– Generates tests
➡️ Type /
to see available slash commands
🧩 Quick Chat (Lightweight Prompting)
For quick one-off questions:
-
Ctrl+Shift+Alt+L
to open Quick Chat -
Found under Copilot Menu → Quick Chat
➡️ You can promote a Quick Chat to a full session using “Open in Chat View”
✍️ Apply Code from Chat Responses
When Copilot provides a code block:
-
Hover over the block
-
Click Apply in Editor to insert it smartly into your file
💡 Alternatively:
-
Copy, Insert at Cursor, or Insert into Terminal (for shell commands)
Keyboard Shortcuts:
-
Next Code Block:
Ctrl+Alt+PageDown
-
Previous Code Block:
Ctrl+Alt+PageUp
🧠 Tips for Effective Use
Tip | How |
---|---|
Add project-specific context | Use #codebase , #<file> , or drag files into chat |
Use IntelliSense for prompts | Press # , @ , or / to auto-suggest context items |
Prefer Ask Mode for Q&A | Use Edit/Agent mode for making actual code changes |
Use instruction files | Define custom style/rules once for all chats (Markdown) |
📘 Example Prompts
📚 Related Features
-
🔄 Edit Mode – For making direct changes to code
-
🤖 Agent Mode – For autonomous workflows and multi-file edits
0 件のコメント:
コメントを投稿