Movatterモバイル変換


[0]ホーム

URL:


TryMCP servers to extend agent mode in VS Code!

Dismiss this update

Inline chat

With Copilot inline chat in Visual Studio Code, you can ask questions and get suggestions directly in the editor or get help with shell commands within the integrated terminal. Inline chat allows you to stay in the flow of your work without having to switch to a separate Chat view.

Prerequisites

Use editor inline chat

When you use editor inline chat, your prompt is scoped to the code in the active editor. Inline chat might use the content from other files in your workspace as context for your prompt.

To use editor inline chat:

  1. Open a file in the editor.

  2. Open editor inline chat by using the⌘I (Windows, LinuxCtrl+I) keyboard shortcut or selectingEditor Inline Chat from the Copilot menu in the title bar.

    Notice how Copilot shows a chat input field at your cursor position in the editor.

  3. Enter your prompt in the chat input field.

    Select a block of code in the editor to scope the prompt to that code.

    Experiment with some of these example prompts to get started:

    • Refactor this code to use async/await
    • Explain this code
    • Add error handling
  4. Notice that Copilot shows code suggestions inline in the editor. Accept or reject the changes.

    Copilot Inline Chat asking to not use recursion for a factorial function.

  5. Optionally, ask a follow-up question to get other or suggestions or refine the results.

Tip

Attach context to your Inline Chat prompt to include relevant files, code symbols, or other context. Learn more aboutadding context to your chat prompt.

Use terminal inline chat

You can bring up terminal inline chat in theintegrated terminal to get help with shell commands or ask terminal-related questions.

To use terminal inline chat:

  1. Open the terminal in VS Code by selecting theView >Terminal menu item or using the⌃` (Windows, LinuxCtrl+`) keyboard shortcut.

  2. Open terminal inline chat by using the⌘I (Windows, LinuxCtrl+I) keyboard shortcut or running theTerminal Inline Chat command in the Command Palette.

    Copilot shows a chat input field at the current position in the terminal.

  3. Enter your prompt in the chat input field.

    Experiment with some of these example prompts to get started:

    • How do I install npm packages?
    • List the top 5 largest files in the src directory
    • undo the last git commit

    Screenshot showing that you can ask complex questions like "list the top 5 largest files in the src dir"

  4. Review the response and select theRun (⌘Enter (Windows, LinuxCtrl+Enter)) to run the command in the terminal

    Optionally, selectInsert (⌥Enter (Windows, LinuxAlt+Enter)) to insert the command into the terminal and modify it before running.

Related resources

07/09/2025

[8]ページ先頭

©2009-2025 Movatter.jp