Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 6 of 30
❮Prev Next❯

Inline Suggestions, Chat, Edit and Agent Mode

Module 2: Copilot Features ⏱ 10 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    You trigger GitHub Copilot in four main ways. Inline suggestions appear as grey ghost text while you type (Tab accepts, Esc dismisses, Alt+] shows the next one). Inline chat (Ctrl+I) changes the code in front of you. The Chat view (Ctrl+Alt+I) has three modes: Ask answers without editing, Edit changes the files you pick for you to Keep or Undo, and Agent plans, edits, runs commands after your approval and iterates until the task is done. In the terminal, Copilot CLI does the same agent work.

    Simulate it » No Azure account needed

    Exam objective: 2.1.2 Trigger Copilot through inline suggestions, chat, CLI, and agent mode. (Skills measured as of August 7, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    VS Code & GitHub: Inline suggestions, inline chat and the Chat view Ghost text, inline chat, the Chat view and the mode picker.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading…

    Start typing and pause: Copilot shows a <strong>ghost text</strong> suggestion. <strong>Tab</strong> accepts it all, <strong>Ctrl+→</strong> accepts one word, <strong>Alt+]</strong> shows the next alternative, <strong>Esc</strong> dismisses.

    👆 Click the glowing item on screen to continue

    Read the steps as text
    1. Start typing and pause: Copilot shows a ghost text suggestion. Tab accepts it all, Ctrl+→ accepts one word, Alt+] shows the next alternative, Esc dismisses.
    2. Press Ctrl+I for inline chat right in the editor. Describe the change for the selected code.
    3. Copilot shows the change in place. Accept keeps it, Discard throws it away.
    4. Open the Chat view (Ctrl+Alt+I) for longer conversations. The mode picker switches between Ask (answers), Edit (changes files you choose) and Agent (does the whole task).
    5. In Agent mode the same request makes Copilot find the files, edit them, run the tests and report back. Next edit suggestions (NES) also predict your next edit as you work.

    🧪 Simulation for learning. Screens are simplified versions of Visual Studio Code and github.com with GitHub Copilot; names, files and suggestions are examples. Not affiliated with GitHub or Microsoft, and nothing here touches your real account.

    😟 THE PROBLEM

    You only ever use ghost text and wonder why Copilot can’t do more.

    😊 THE SOLUTION

    Use the right surface: inline, inline chat, or the Chat view in Ask, Edit or Agent mode.

    • Typing boilerplate✓ Inline suggestions
    • A change across files✓ Edit mode
    • A whole task with tests✓ Agent mode
    🛠️ Solved with: Copilot in the editor

    Start with a question

    If a helper sits next to you while you cook, do you want them to hand you the salt, answer a question, or cook the whole dish?

    It depends on the moment. Sometimes you only want the salt passed before you reach for it. Sometimes you want to ask “is this oil hot enough?”. And some evenings you’d happily say “make dinner, and tell me before you turn the oven on”.

    GitHub Copilot works the same way. Inline suggestions pass you the next line before you ask. Ask mode answers your question. Edit mode changes the files you point at. Agent mode takes the whole task and asks before it runs anything in your terminal.

    Explain it like I’m 10

    The technical explanation

    Inline suggestions (ghost text)

    When you pause while typing, the Copilot extension sends the code around your cursor as context and shows the reply as grey ghost text. Nothing goes into your file until you accept it.

    ActionWindows / LinuxmacOS
    Accept the whole suggestionTabTab
    Dismiss itEscEsc
    Next / previous alternativeAlt+] / Alt+[Option+] / Option+[
    Accept the next word onlyCtrl+Right ArrowCmd+Right Arrow
    Open the completions panel (several options)Ctrl+EnterCtrl+Enter

    Say you type the start of a function in src/discount.js:

    export function applyDiscount(total, code) {
      // ghost text appears here:
      const pct = CODES[code] ?? 0;
      return Math.max(0, total - (total * pct) / 100);
    }

    Writing a clear function name and a short comment first gives Copilot much better context than an empty file.

    Next edit suggestions (NES) go a step further. Rename a parameter on line 3, and Copilot predicts the matching edit on line 9 and offers it. You jump to it and press Tab.

    To turn completions off for one language, set github.copilot.enable in your settings, for example { "*": true, "markdown": false }. The Copilot icon in the status bar also lets you snooze suggestions.

    Inline chat (Ctrl+I)

    Select some code, press Ctrl+I and type what you want: “make unknown codes return the total unchanged”. Copilot shows the change as a diff in place. Accept keeps it, Discard throws it away. Use it for small, local changes where opening a full chat would be overkill.

    The Chat view and its three modes

    Open the Chat view with Ctrl+Alt+I. A picker at the bottom switches the mode.

    Ask

    Answers

    • Explains code and concepts
    • Suggests code blocks you can insert
    • Doesn't edit files on its own

    Edit

    Copilot Edits

    • Changes the files you add to the working set
    • Several files in one go
    • You Keep or Undo each diff

    Agent

    Does the task

    • Finds the files itself
    • Runs terminal commands after you approve
    • Reads errors and test output, then iterates
    • Can call MCP tools
    Three chat modes, three levels of hands-on

    Here’s the same request in each mode: “Add a FREE code that gives 100% off, with tests.”

    • Ask explains how you’d do it and shows code. You copy what you want.
    • Edit changes src/discount.js and tests/discount.test.js if you added them, and waits for Keep or Undo.
    • Agent searches the codebase, edits both files, asks to run npm test, reads the result and fixes a failure before reporting back.
    1. 1 Plan

      Reads the request and searches the codebase for the right files.

    2. 2 Edit

      Changes the files and shows each diff.

    3. 3 Run

      Asks before running npm test or any other terminal command.

    4. 4 Iterate

      Reads the output, fixes failures and runs again.

    5. 5 Report

      Summarises what changed. You Keep or Undo.

    What agent mode does with one request

    Agent mode is covered properly, with MCP tools and sub-agents, in its own lesson.

    Outside VS Code

    Visual Studio, JetBrains IDEs, Xcode, Eclipse and Vim/Neovim all have Copilot extensions with inline suggestions, and most have chat. Feature names and shortcuts differ a little, so check the docs for your editor. In the terminal, Copilot CLI (the copilot command) gives you an agent that reads your repo, edits files and runs commands with your permission. On github.com you can assign an issue to the Copilot coding agent, which opens a draft pull request.

    Architect level Why suggestions change when you open other tabs

    Inline suggestions don’t only look at the current file. The extension also pulls snippets from other open tabs and neighbouring files to build the prompt, then trims it to fit the model’s context window. That’s why a test file open next to your code gives better suggestions, and why ten unrelated tabs can make them worse. Chat works differently: it uses the active file, your selection and whatever you add with #file, #codebase or a participant such as @workspace. Agent mode searches the workspace on its own. If a file is covered by a content exclusion, Copilot won’t use it as context or suggest inside it in supported IDEs.

    Real-world business scenario

    Online retail

    Contoso (fictional)

    The problem
    Contoso's shop team turned on Copilot and everyone used Agent mode for everything. Simple questions about the cart code produced surprise edits, and reviewers were tired of undoing changes nobody had asked for.
    What they used
    A short team guide: inline suggestions and Ctrl+I for small changes, Ask mode to understand code, Edit mode for planned multi-file changes, and Agent mode for whole tasks with tests, with commands approved once rather than for the session.
    Why that choice
    Each surface matches how much control the developer wants to hand over, so changes only happen when someone meant them to.
    The result
    Unwanted edits in pull requests dropped, and new joiners used Ask mode to learn the codebase without touching it.

    When to use it and when not to

    ✓ Use it when…

    • Inline suggestions for boilerplate, repetitive code and the next line you were about to type.
    • Ask mode to understand unfamiliar code or compare approaches before changing anything.
    • Edit mode when you know exactly which files should change.
    • Agent mode for a whole task that needs searching, edits, commands and a few rounds of fixing.

    ✕ Think twice when…

    • Accepting long suggestions without reading them. They can be wrong, outdated or insecure.
    • Agent mode for a quick question. It may start changing files.
    • Approving every command for the session on a repository you don't know well.

    ↔ Alternatives to consider

    • Copilot CLI when you live in the terminal or want to script a prompt.
    • Copilot coding agent on github.com to hand off an issue and get a draft pull request back.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the GH-300 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    A developer wants GitHub Copilot in Visual Studio Code to explain how a function in src/legacy/report.js works. The file must not be modified. Which Copilot Chat mode should the developer use?

    Question 2

    Question 2 of 5

    You request a change in Copilot Chat. Copilot must locate the relevant files, modify them, run the test suite in the terminal and fix any failures before it reports back. Which mode should you select?

    Question 3

    Question 3 of 5

    Copilot displays a long inline suggestion in Visual Studio Code. You want to accept only the first word of the suggestion. Which action should you perform on Windows?

    Question 4

    Question 4 of 5 · Select 2

    A developer uses GitHub Copilot in Visual Studio Code. Which TWO statements describe Edit mode (Copilot Edits)? Each correct answer presents a complete solution.

    Question 5

    Question 5 of 5

    A team wants Copilot inline suggestions in JavaScript files but not in Markdown files in Visual Studio Code. What should each developer configure?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner How do you accept only part of an inline suggestion?

    Model answer

    I press Ctrl plus Right Arrow to take the next word, and keep pressing it until I have what I want. Tab takes the whole thing. If none of the options fit, Alt plus right bracket cycles to the next suggestion, or I open the completions panel with Ctrl plus Enter.

    Interviewer follows up

    And if you don't want suggestions at all in Markdown files?

    You

    I set github.copilot.enable to false for markdown in my settings. Completions stay on for every other language.

    Intermediate When would you pick Edit mode over Agent mode?

    Model answer

    When I already know which files need to change and want tight control. Edit only touches the files I add and shows me each diff. Agent decides which files to open, runs commands and loops, which is great for a whole task but more than I need for a rename across three files.

    Experienced developer A teammate says agent mode ran a command they didn't expect. How do you explain what happened?

    Model answer

    Agent mode asks before it runs a terminal command, but you can approve a command for the session, and after that it won't ask again for that command in that session. I'd check what they approved, remind them that Allow once is the safer default, and review the chat log, which lists every tool call and command it ran.

    Scenario A developer wants to understand a legacy file without risking any change to it. Which Copilot surface do you recommend?

    Model answer

    Ask mode in the Chat view, with the file added as context. Ask explains and suggests code blocks but never edits files on its own, so there's nothing to undo.

    Quick revision

    Key points

    • Inline suggestions: Tab accept, Esc dismiss, Alt+] / Alt+[ next and previous (Option on macOS), Ctrl+Right Arrow next word, Ctrl+Enter completions panel.
    • Next edit suggestions (NES) predict your next edit, not only the next characters.
    • Inline chat is Ctrl+I and changes code in place; the Chat view is Ctrl+Alt+I.
    • Ask answers, Edit changes the files you choose, Agent does the whole task and runs commands after approval.
    • github.copilot.enable turns completions on or off per language.
    • Copilot CLI brings agent-style work to the terminal with the copilot command.

    Important terminology

    Inline suggestion
    Grey ghost text Copilot shows at the cursor as you type. Tab accepts it, Esc dismisses it.
    Next edit suggestions (NES)
    Copilot predicts where your next edit will be and what it should be, based on the change you just made.
    Inline chat
    A small chat box opened with Ctrl+I inside the editor that changes the selected code in place.
    Ask mode
    Chat mode that answers questions and suggests code blocks but doesn't edit your files.
    Edit mode
    Chat mode (Copilot Edits) that applies changes across the files you choose and lets you Keep or Undo each diff.
    Agent mode
    Chat mode where Copilot picks the files, edits them, runs terminal commands after approval, reads the results and iterates.

    Common mistakes

    • Using Agent mode just to ask a question, when Ask would answer without touching files.
    • Pressing Tab on a long suggestion without reading it.
    • Thinking Edit mode can run tests. Running commands is Agent mode.

    Exam tips

    • "Answer only, no file changes" = Ask mode.
    • "Change these three files and let me review each diff" = Edit mode.
    • "Implement the feature, run the tests and fix failures" = Agent mode.

    Five quick revision questions

    1. 1.Which key accepts a whole inline suggestion?Show

      Tab

    2. 2.Which shortcut opens inline chat in VS Code?Show

      Ctrl+I

    3. 3.Which chat mode can run terminal commands?Show

      Agent mode

    4. 4.Which setting turns completions off for one language?Show

      github.copilot.enable

    5. 5.What does Ctrl+Right Arrow do with a suggestion?Show

      Accepts the next word only.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Copilot Chat: Slash Commands, Participants and Limits

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.