Exercise template for interacting with Github Copilot via Visual Studio Code.
- Clone this repository
- Download Visual Studio Code - or update it to the latest version (if already installed)
- Setup your preferred keybindings if necessary. If you're a IntelliJ user, you can install the VSCode extension "IntelliJ IDEA Keybindings" to use the same keybindings as in IntelliJ. See this link: https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings
- Open the following URL and signup for ChatGPT: https://chat.openai.com/auth/login
- Use the Quatico Google account to sign up if you don't have an account yet.
- Start a new chat and say "Hi" to the bot.
- Open this project using Visual Studio Code.
- Ensure that you have a Github account: https://github.com/signup
- Ensure you've signed up for Github Copilot "Copilot Individual" (30 days trial is fine). If not, please do so here: https://github.com/github-copilot/signup - More general link: https://copilot.github.com
- Unfortunately, a valid credit card is required to sign up to Github Copilot even if the trial is free. If this is a problem or should you not have a credit card, please contact me.
- You can cancel the subscription immediately after the qBits and you will not be charged.
- Install the recommended extensions. If VSCode does not prompt you to install them, you can install them manually. See the
.vscode/extensions.json
file for the list of recommended extensions. - Ensure you've installed the Copilot VSCode extension: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot and that you've logged in with your Github account. Double check the tiny Github icon at the bottom right of VSCode.
- Test that Copilot is working by:
- opening a new file and typing
//
and then pressingEnter
. Copilot should suggest a comment. - Use the command for "Run" (Shortcut:
CMD + SHIFT + P
, IntelliJ users use whatever Action/Command shortcut that you've defined) and type "Copilot" and select "Copilot: Generate this". Type something, Copilot should generate code for you.
- opening a new file and typing
You've successfully completed the setup! The rest of the README is only relevant for the workshop.
Copilot: Generate this
- Generate code in the current file.Copilot: Fix this
- Suggests a code fix for the current file.Copilot: Generate tests
- Generates tests for the current file and places the code in a separate file.Copilot: Generate docs
- Generates documentation for the current class or function.Copilot: Explain this
- Explains the code at the current cursor position. Uses the context of the whole file and interacts with Copilot chat.
- Java 17
The required Gradle version is downloaded automatically.
./gradlew
### Tests
./gradlew test
### Tests in Watch Mode
./gradlew test -t
- Node.js 18
- Yarn 1.22.19
yarn
yarn lint
yarn test
yarn test:watch
yarn check:types