Improve Developer Productivity with GitHub Copilot Study Guide — GH-300

15% of the exam · domain 5 of 6 · GitHub Copilot · Free Improve Developer Productivity with GitHub Copilot practice questions

0 of 51 topics covered
What the exam asks here — tap to tick off0 / 9 covered
Domain 5 of 6

Developer Use Cases — IDE, CLI, Chat

This domain tests your ability to apply GitHub Copilot across practical software development workflows: writing code, generating tests and documentation, debugging, refactoring, and using Copilot in both IDE and CLI contexts. It also tests your knowledge of how to optimize Copilot's context and where its limitations require human review. This domain carries 35% of the exam weight, making it the highest-weighted single domain. Expect scenario-based questions that ask you to identify the correct tool, command, variable, or workflow for a described situation.


Code Completion

How Copilot Generates Suggestions

GitHub Copilot provides inline code completions as you type, drawing on the context of your open file, neighboring open tabs, and your current cursor position. Suggestions appear as ghost text — gray, dimmed text rendered after your cursor.

Accepting suggestions:

ActionShortcut (VS Code default)What it does
Accept full suggestionTabInserts the entire ghost-text suggestion
Accept next word onlyCtrl+Right (Windows/Linux) / Cmd+Right (macOS)Accepts one word at a time from the suggestion
Dismiss suggestionEscapeClears the ghost text without inserting anything
Cycle to next suggestionAlt+]Shows the next alternative suggestion
Cycle to previous suggestionAlt+[Shows the previous alternative suggestion
Open Copilot completions panelCtrl+EnterOpens a panel with up to 10 alternative completions

Common traps:

  • The exam may list Enter as a distractor for accepting suggestions — Enter inserts a newline, not the suggestion.
  • Ctrl+Right accepts only the next word, not the full line — distinguish this from Tab clearly.
  • The completions panel (Ctrl+Enter) shows up to 10 suggestions, not unlimited.
  • Copilot does not require a specific comment structure to trigger suggestions; it reads your code context automatically, but comments do act as strong prompts.

Worked Scenario

Requirement: A developer sees a Copilot suggestion for a 12-line function but only wants to accept the function name and opening parenthesis.

Reasoning: Use Ctrl+Right repeatedly to accept one word at a time instead of pressing Tab, which would accept the entire suggestion.


Inline Chat: Slash Commands

Inline chat is opened in the editor with Ctrl+I (Windows/Linux) or Cmd+I (macOS). It lets you interact with Copilot in context — against selected code or at the cursor position — without leaving the editor.

Slash Commands Reference

CommandPurposeTypical input
/fixFix a bug, error, or highlighted problem in selected codeSelect broken code, type /fix
/explainExplain what selected code does in plain languageSelect any code block
/testsGenerate unit tests for the selected function or classSelect a function definition
/docGenerate documentation (docstring, JSDoc, etc.) for selected codeSelect a function or class

Key behaviors:

  • Slash commands work in inline chat (Ctrl+I) and also in the Chat panel (sidebar).
  • /fix operates on the highlighted selection — you must select the problematic code first.
  • /explain can be used without selection; Copilot then explains the code around the cursor.
  • /tests respects the test framework already present in your project (detected from config files like jest.config.js, pytest.ini).
  • /doc generates framework-appropriate documentation: JSDoc for JavaScript/TypeScript, docstrings for Python, XML comments for C#.

Common traps:

  • /fix does not automatically run or validate the fix — you must review and apply it.
  • /tests is the slash command for test generation; do not confuse with a hypothetical /test (singular) — the exam uses /tests.
  • /doc generates documentation for the selected code, not for the whole file unless the whole file is selected.
  • Using /explain on a stack trace in the terminal is a valid pattern but uses a different entry point (see Chat Variables below).

Unlock with a paid plan

12 more sections (about 2,916 words) continue below. Every paid plan unlocks all GH-300 study guides, the full question bank and mock exams, from $4.97/month.