Copilot on VSCode Flashcards

Reference and terminology on GitHub Copilot integration into VS Code

1
Q

What are the 4 different ways to initiate a chat conversation with Copilot ?

A
  1. Chat view
  2. Inline Chat
  3. Quick Chat
  4. Copilot Edits view
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

There are many use cases for Copilot in VS Code. List 7 use cases involving direct code generation

A
  1. Code completions in the editor
  2. Iterate on large changes across multiple files using multi-turn chat conversation
  3. Provide guidance and support for common coding tasks and challenge, which can be tailored to the current workspace or project context
  4. Improve code understanding by explaining selected code
  5. Suggestions for code refactoring and improvements
  6. Generate a new workspace with scaffolding for the project structure based on a specific tech stack
  7. Generate scaffolding for a new Juypter notebook
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

There are many use cases for Copilot in VS Code. List 5 use cases related to debugging and testing

A
  1. Propose bug fixes
  2. Propose fixes for failing tests and terminal command errors
  3. Configure testing framework setup
  4. Generate unit test cases for this testing framework based on specific context
  5. Generate test cases for edge cases and boundary conditions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

There are many use cases for Copilot in VS Code. List 6 use cases that does not involve direct code generation.

A
  1. Generate code documentation for selected code snippet
  2. Suggestions for terminal or shell related commands / functionality
  3. New rename suggestions for source code symbols
  4. Semantic search results
  5. Generate commit messages and PR descriptions
  6. Get help on relevant VS Code commands
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the purpose of adding chat context to a chat prompt in the Chat view ?

A

To help Copilot give you the best and most relevant answers by scoping the response to a specific context

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is automatically added as context to the chat prompt in the Chat view ?

A

The currently active editor
If a block of code selected in the editor, only that selection is added as context.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

List the 3 ways to add context to your chat prompt

A

1) Use the paperclip button icon in any of the chat interactions, then select the specific type of context from a Quick Pick
2) Drag and drop editor tabs, or files or folders from the Explorer view, Search view, or editor breadcrumb onto the Chat view.
3) Use chat variables by typing the # character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Inline Chat and how is it helpful ?

A

Inline Chat enables you to have a chat conversation with Copilot directly from the editor.
Allows preview code suggestions (modifications / refactoring) in-place within your code, which can be useful for quickly iterating on code changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Where is another common location that inline Chat is available at and how is it used ?

A

In the terminal to help you answer questions related to the terminal and shell commands, using the @terminal chat participant

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Where is the Chat view located by default ?

A

The Secondary Sidebar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When Copilot chat returns source code in a code block, state 2 features of this block

A

a) Depending on the language extension, the code block in the chat response might support IntelliSense, which enables you get information about methods and symbols by hovering over them
b) Hovering over the code block presents various options such Smart Apply generated code block in Active Editor, Insert generated code block at Cursor, and Copy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When would you use Quick Chat ?

A

If you want to ask Copilot a quick question and don’t want to start a full Chat view session or open Inline Chat in your editor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are multi-turn conversations and how are they possible ?

A

Iterating and prompting Copilot to improve on initial suggestions
This is possible since Copilot has both the context of the generated code and chat conversation history

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are smart actions and how are they accessed ?

A

Actions to obtain specific help from Copilot without using a prompt. They are accessed from the editor context menu when a block of code is highlighted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Give the 5 types of smart actions available through the editor context menu?

A
  1. Explain
  2. Fix
  3. Review and Comment
  4. Generate Docs
  5. Generate Tests
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How is the Fix smart action alternatively accessed and how does it appear?

A

From the context menu that appears when the cursor is positioned on a term or statement where an error or issue has been flagged.
It appears as Fix using Copilot

17
Q

What other Copilot feature is the Fix Smart action a shortcut for ?

A

Inline chat with the /fix slash command

18
Q

What does a Code Action icon (small lightbulb) with an additional sparkle at its edge mean?

A

It provides a comprehensive list of options code fix or code refactoring, including Copilot smart actions

19
Q

What are chat participants and how are they accessed?

A

They are domain experts (context-specific components) integrated with the Copilot environment which enable Copilot Chat to interact with various aspects of the user’s workflow.
Accessed by typing @ followed by the participant name

20
Q

List the 4 main built-in chat participants and the knowledge/context that they possess

A
  1. @workspace has context about the code in your workspace
  2. @vscode knows about commands and features in the VS Code editor
  3. @terminal has context about the integrated terminal shell and its contents
  4. @github has knowledge about your GitHub repositories, issues, pull requests, and topics
21
Q

1.1.21 Where else can additional chat participants be obtained from?

A

Extensions from the VS Marketplace

22
Q

1.1.22 How do chat participants provide shortcuts to specific functionality?

A

Through slash commands

23
Q

1.1.23 How do you include slash commands in a chat prompt? Give a simple example

A

Start with the participant followed by the slash / and finally the command, for e.g. @workspace /fix

24
Q

1.1.24 Give 3 common built-in slash commands for the @workspace participant ?

A
  1. @workspace /explain (or /explain): explain how the selected code works
  2. @workspace /fix (or /fix): propose a fix for the problems in the selected code
  3. @workspace /new (or /new): scaffold code for a new workspace or new file
25
Q

1.1.25 What is the purpose of the conversation history?

A

For Copilot to use as context in subsequent prompts in a multi-turn conversation

26
Q

1.1.26 In what way can you work with the conversation history to get more relevant responses in a multi-turn conversation?

A

Delete a previous prompt and its response from the conversation history

27
Q

1.1.27 What are the 3 key features of Copilot Edits ?

A
  1. Combines conversational flow of Copilot Chat and fast feedback
  2. Allows iteration on large changes on multiple files in the workspace through multi-turn chat conversation
  3. Edits are applied directly in the editor so that they can be reviewed in place
28
Q

1.1.28 What are the general sequence of actions associated with working with Copilot Edits?

A
  1. Add files to the working set
  2. Request code edits
  3. Save generated edits
  4. Accept or discard edits
  5. Undo edits
29
Q

1.1.29 What is the working set in the context of Copilot Edits and how does Copilot use it?

A

The relevant files you want to work with.
Copilot Edits will limit changes only to the working set, except when suggesting to create new files

30
Q

1.1.30 When will you transfer a chat session over to Copilot Edits from Copilot chat, how is it done and what is the advantage of doing this?

A

When you are satisfied and ready to apply suggested code changes provided in Chat response.
This done by selecting Edit with Copilot in the Chat view
The advantage of doing this is that you can let Copilot Edits apply all the changes across multiple files in the project, instead of having to apply each code block individually from the Chat view

31
Q

1.1.31 What are the 6 steps involved in requesting code edits in Copilot Edits?

A

1) Enter a chat prompt specifying the edit required
2) Copilot Edits lists the files that are edited and provides a short description of the changes
3) Opens editor tabs for all affected files that were edited
4) Visually indicates which files in the working set are edited
5) You can select an affected file from the working set (based on its visual change) or from the list of edited files
6) You can view the proposed edits (typically highlighted in green) in the file and decide whether to accept or discard them.

32
Q

1.1.32 What are the 4 options available for working with the suggested code edits in the Copilot Edits chat area?

A
  1. You can select to view all edits which appears in a new editor
  2. You can choose to accept or discard all the suggested edits in the working set
  3. You can select the individual affected files in the working set to decide whether to accept or discard their corresponding changes
  4. You can undo the last edit or redo the last edit in the Copilot Edits view title bar