-
Notifications
You must be signed in to change notification settings - Fork 41
docs: Add IntelliJ GitHub Copilot Tutorial (Sections 1–5 with images) #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
arshinsikka
wants to merge
5
commits into
se-edu:master
Choose a base branch
from
arshinsikka:intellij-copilot-tutorial-final
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e8abc34
docs: Add GitHub Copilot in IntelliJ IDEA tutorial with all images
arshinsikka14 2f969e6
docs(vscode-copilot): remove redundant restart-prompt and accepted-fi…
arshinsikka14 b7960ca
docs(intellij): finalize Copilot tutorial—link to shared access prere…
arshinsikka14 34a82dd
docs(intellij): resolve merge conflicts and finalise GitHub Copilot t…
arshinsikka14 3782e46
Merge branch 'master' into intellij-copilot-tutorial-final
arshinsikka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| <frontmatter> | ||
| title: "IntelliJ IDEA – Using GitHub Copilot" | ||
| pageNav: 2 | ||
| </frontmatter> | ||
|
|
||
| # IntelliJ IDEA – Using GitHub Copilot | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This page needs to be linked from the main landing page (index.md) |
||
|
|
||
| GitHub Copilot is an AI-powered code assistant that helps you write, test, and refactor code faster. In this tutorial, you’ll learn how to set up and use Copilot in IntelliJ IDEA — perfect for students in CS2103/T, CS2113, and other Java-heavy modules. | ||
|
|
||
| <box type="info" seamless> | ||
| To use GitHub Copilot for free as a student, you must: | ||
|
|
||
| 1. Sign up for a GitHub account | ||
| 2. Enable two-factor authentication (2FA) | ||
| 3. Apply for the GitHub Student Developer Pack | ||
|
|
||
| This guide walks you through setting up Copilot access and using it in IntelliJ IDEA. | ||
| </box> | ||
|
|
||
| --- | ||
|
|
||
| ## 1. Setting Up GitHub Copilot Access | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part is not specific to Intellij. Must be covered in somewhere else already. |
||
|
|
||
| ### Step 1: Fill in Billing Information | ||
|
|
||
| 1. Visit the [GitHub billing settings page](https://github.com/settings/billing). | ||
| 2. Fill in only your billing address (no charges will occur if you qualify for student access). | ||
| 3. Click **Save billing information**. | ||
|
|
||
| <img src="images/intellijcopilot/copilot-billing-settings.jpeg" alt="Billing Settings Page" width="60%" /> | ||
|
|
||
| ### Step 2: Enable Two-Factor Authentication (2FA) | ||
|
|
||
| 1. Go to [GitHub security settings](https://github.com/settings/security). | ||
| 2. Click **Enable two-factor authentication** and follow the prompts. | ||
| 3. Use an authenticator app (e.g., Google Authenticator, Microsoft Authenticator) to complete setup. | ||
|
|
||
| <img src="images/intellijcopilot/github-2fa-settings.jpeg" alt="2FA Settings Page" width="60%" /> | ||
|
|
||
| ### Step 3: Link Your University Email | ||
|
|
||
| 1. Go to [GitHub email settings](https://github.com/settings/emails). | ||
| 2. Add your university email (e.g., yourname@u.nus.edu). | ||
| 3. Verify via the confirmation link sent to your inbox. | ||
|
|
||
| <pic src="tutorials/images/intellijcopilot/link-university-email.png" width="500" /> | ||
|
|
||
| ### Step 4: Apply for GitHub Student Developer Pack | ||
|
|
||
| 1. Visit the [GitHub Education Pack page](https://education.github.com/pack). | ||
| 2. Click **Get student benefits** and complete the application. | ||
| 3. After approval, you’ll see a message like “You already have the Student Developer Pack.” | ||
|
|
||
| <img src="images/intellijcopilot/copilot-education-pack.jpeg" alt="Student Pack Confirmation" width="60%" /> | ||
|
|
||
| --- | ||
|
|
||
| ## 2. Installing GitHub Copilot Plugin in IntelliJ IDEA | ||
|
|
||
| 1. Open IntelliJ IDEA. | ||
| 2. On Mac: **IntelliJ IDEA > Preferences**. On Windows/Linux: **File > Settings**. | ||
| 3. Select **Plugins > Marketplace**. | ||
| 4. Search for **GitHub Copilot**. | ||
| <img src="images/intellijcopilot/intellij-search-copilot.png" alt="Search GitHub Copilot Plugin" width="60%" /> | ||
| 5. Click **Install**, then **Restart IDE** when prompted. | ||
| <img src="images/intellijcopilot/intellij-restart-prompt.png" alt="Restart Prompt" width="60%" /> | ||
|
|
||
|
|
||
| --- | ||
|
|
||
| ## 3. Signing In to GitHub | ||
|
|
||
| 1. After restart, open **Settings > Languages & Frameworks > GitHub Copilot**. | ||
| 2. Under **Authentication**, click **Manage GitHub Accounts**. | ||
| 3. Sign in via your browser and authorize Copilot. | ||
| 4. Your GitHub username should appear in the **Preferred GitHub account** dropdown. | ||
|
|
||
| <img src="images/intellijcopilot/intellij-copilot-settings.png" alt="Copilot Settings in IntelliJ" width="60%" /> | ||
|
|
||
|
|
||
| --- | ||
|
|
||
| ## 4. Verifying Copilot in Action | ||
|
|
||
| 1. Create or open a Java file, e.g., `CopilotTest.java`. | ||
| 2. Inside a `main` method, type: | ||
|
|
||
| ```java | ||
| // print Hello World | ||
| ``` | ||
|
|
||
| 3. Wait 2–3 seconds — a gray suggestion appears. | ||
| 4. Press **Tab** to accept the suggestion. | ||
|
|
||
| <img src="images/intellijcopilot/copilot-suggestion-visible.png" alt="Copilot Suggestion Appears" width="60%" /> | ||
| <img src="images/intellijcopilot/copilot-accepted-fixed.png" alt="Copilot Suggestion Example" width="60%" /> | ||
|
|
||
| <box type="tip" seamless> | ||
| Copilot works best with clear, descriptive comments. | ||
| </box> | ||
|
|
||
| --- | ||
|
|
||
| ## 5. Using Copilot Chat *(if available)* | ||
|
|
||
| > Copilot Chat may be in beta or limited in IntelliJ. | ||
|
|
||
| 1. Go to **View > Tool Windows > Copilot Chat**. | ||
| 2. Ask a question, e.g.: | ||
|
|
||
| ```java | ||
| Write a function to reverse a string in Java. | ||
| ``` | ||
|
|
||
| 3. Review the response and insert code as needed. | ||
|
|
||
| <img src="images/intellijcopilot/copilot-chat-window.png" alt="Copilot Chat Window" width="60%" /> | ||
|
|
||
| --- | ||
|
|
||
| ## 6. Troubleshooting | ||
|
|
||
| <box type="tip" seamless> | ||
| **Common Issues & Fixes** | ||
|
|
||
| - **No suggestions** → Ensure the plugin is enabled and you’re signed in. | ||
| - **No Copilot panel** → Restart IntelliJ or reinstall the plugin. | ||
| - **Unsupported file type** → Use `.java` or other supported languages. | ||
| - **Authentication errors** → Re-authorize in **Settings > GitHub Copilot**. | ||
| </box> | ||
|
|
||
| --- | ||
|
|
||
| **Contributors:** Arshin Sikka (@arshinsikka) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include the warning about this being a WIP community contribution, similar to other tutorials added recently.