diff --git a/tutorials/cursorIntellij.md b/tutorials/cursorIntellij.md new file mode 100644 index 00000000..ad6bf433 --- /dev/null +++ b/tutorials/cursorIntellij.md @@ -0,0 +1,70 @@ +{% set title="IntelliJ IDEA - Using Cursor" %} + + title: "{{ title }}" + pageNav: 2 + + + + +# {{ title }} + +Cursor is primarily built on VS Code, but it can also be used to **assist with coding tasks in IntelliJ IDEA** through the Cursor Chat web interface and integration via code snippets. +Think of it as having *ChatGPT connected to your IntelliJ workflow* — you can generate code, get explanations, and copy results back into your project. + +--- + +## Pre-requisites + +* Install [IntelliJ IDEA](https://www.jetbrains.com/idea/download/). +* Install the Java 17 SDK (Temurin or Oracle JDK). +* Sign up and log in to Cursor (see [Signing Up for Cursor](cursorSignup.md)). + +--- + +## Using Cursor with IntelliJ + +### Step 1: Open Cursor Chat in Browser or App +* Open the Cursor desktop app or visit [cursor.com](https://cursor.com). +* Navigate to the **Chat panel**. +* Ask questions such as: + > "Generate JUnit tests for the `Person` class" + > "Explain this method in plain English" + +Cursor will return results that you can copy into IntelliJ. + + + +--- + +### Step 2: Paste and Adapt in IntelliJ +* Copy generated snippets from Cursor. +* Paste into IntelliJ editor windows. +* Use IntelliJ’s **code inspections** to verify and adapt suggestions. + + +Always run `./gradlew check` after pasting new code to ensure compatibility with Checkstyle and project rules. + + +--- + +### Step 3: Refactor or Explain with Cursor +* Select a block of code in IntelliJ. +* Copy-paste into Cursor chat. +* Ask Cursor to **refactor** (e.g., “make this more efficient”) or **explain** (e.g., “what does this method do?”). +* Cursor will provide updated code or natural-language explanations. + +--- + +## Responsible Usage + +* Use Cursor in IntelliJ mainly for **learning and scaffolding** (e.g., test generation, clarifying errors). +* Avoid using Cursor to auto-generate entire project features. +* Always cross-check AI output against IntelliJ inspections, unit tests, and Checkstyle rules. + + +Cursor complements IntelliJ’s powerful IDE features by acting as an *AI coding buddy*. + + +--- + +**Contributors**: Arshin Sikka ([@arshinsikka](https://github.com/arshinsikka)) diff --git a/tutorials/cursorSignup.md b/tutorials/cursorSignup.md new file mode 100644 index 00000000..4003b188 --- /dev/null +++ b/tutorials/cursorSignup.md @@ -0,0 +1,45 @@ +{% set title="Signing Up for Cursor" %} + + title: "{{ title }}" + pageNav: 2 + + + + +# {{ title }} + +
+ +**Cursor is an AI-powered code editor built on top of VS Code.** +To use Cursor’s AI features, you need to create an account and sign in. +Follow the steps below to get started: + +## Step 1: Create a Cursor Account + +* Go to the [Cursor signup page](https://cursor.com). +* Click on **Download** for your platform (macOS, Windows, or Linux). +* Install Cursor just like you would install VS Code. +* Open Cursor after installation — you will be prompted to log in. + +## Step 2: Log in to Cursor + +* Choose a login method: + * Sign in with **Google**, **GitHub**, or **Email**. + * Approve any verification prompts (email verification if required). +* Once signed in, Cursor unlocks AI-powered features such as chat, inline suggestions, and refactoring tools. + + + +## Free Plan and Student Benefits + +* **Free Plan**: Available indefinitely, but with a **monthly token/request limit**. +* **Pro Student Offer**: Verified students can apply for **1 year of free Cursor Pro** (availability depends on country). + + Note: Singapore students may not have access to the Pro student plan. After the one-year period, Pro becomes paid. + + +--- + +**Contributors**: Arshin Sikka ([@arshinsikka](https://github.com/arshinsikka)) + +
diff --git a/tutorials/cursorVscode.md b/tutorials/cursorVscode.md new file mode 100644 index 00000000..ce40d930 --- /dev/null +++ b/tutorials/cursorVscode.md @@ -0,0 +1,103 @@ +{% set title="VS Code - Using Cursor" %} + + title: "{{ title }}" + pageNav: 2 + + + + +# {{ title }} + +Cursor is an AI-powered editor based on **Visual Studio Code**. +If you already know VS Code, Cursor will feel almost identical — but with AI built directly into your coding workflow. +Think of it as *ChatGPT inside VS Code*, helping you autocomplete, refactor, and chat about your code. + +--- + +## Pre-requisites + +* Download and install Cursor from [cursor.com](https://cursor.com). +* Sign in using Google, GitHub, or Email (see [Signing Up for Cursor](cursorSignup.md)). +* Ensure you have Java 17 SDK installed for CS2103/SE-EDU projects. + +--- + +## Setting Up Cursor in VS Code + +* Open Cursor after installation. +* Sign in to your Cursor account if prompted. +* The interface will look almost identical to VS Code, but with extra **Cursor AI icons** in the sidebar and editor toolbar. + + + +--- + +## Basic Code Completion + +Cursor suggests code **inline** as you type. + +* In a Java file, type a comment like: + ```java + // write a method that prints Hello World +Cursor will display a suggestion inline. +* Press `Tab` to accept, or `Esc` to dismiss. + + +The clearer your comment or method name, the better Cursor’s suggestion will be. + + +--- + +## Cursor Chat + +Cursor comes with a **Chat panel**, similar to ChatGPT but aware of your codebase. + +* Click on the **Cursor icon** in the sidebar. +* Ask a coding question, e.g.: + > "Generate JUnit tests for the `Person` class" + > "Explain what this `parseCommand` method does" +* Cursor will return explanations or code snippets you can copy directly. + + +The free plan has a limited monthly quota of AI requests. Heavy usage requires a Pro plan. + + +--- + +## Inline Chat (Inside the Editor) + +You can ask Cursor for help **directly in your code editor**. + +* Highlight or place the cursor where you want help. +* Use the shortcut: {{ icon_windows }}/{{ icon_linux }} `Ctrl+I` | {{ icon_apple }} `Cmd+I`. +* Type a request such as: + > "Add logging here" + > "Refactor this into a helper method" +* Cursor’s generated code will appear inline — you can accept or reject it. + +--- + +## Refactoring and Explaining Code + +Cursor also supports **refactor** and **explain** commands: + +* Right-click on a code block, select **Cursor: Refactor** or **Cursor: Explain**. +* Refactor: suggests a cleaner or more efficient version of the code. +* Explain: generates a natural-language explanation in the chat panel. + +--- + +## Responsible Usage + +Cursor is powerful, but keep in mind: +* Use it for **boilerplate, testing, and learning** — not for writing entire assignment features. +* Always verify suggestions with unit tests and Checkstyle (`./gradlew check`). +* Remember: Cursor is a **helper**, you remain the developer. + + +Treat Cursor like a coding buddy inside VS Code — fast, helpful, but always double-check its work. + + +--- + +**Contributors**: Arshin Sikka ([@arshinsikka](https://github.com/arshinsikka))