diff --git a/docs/guides/about-vscode.md b/docs/guides/about-vscode.md new file mode 100644 index 0000000..5e6307f --- /dev/null +++ b/docs/guides/about-vscode.md @@ -0,0 +1,35 @@ +--- +title: Review local changes +description: How to review your code with the VSCode extension. +slug: /code-editors +sidebar_label: Overview +--- + +This page is about the CodeRabbit VSCode extension. For a broader overview of CodeRabbit, see [Introduction](/). + +## About the VSCode extension + +The CodeRabbit VSCode extension lets you apply a limited subset of CodeRabbit’s code-review features to your local development environment, directly from the VSCode IDE. It also works with other text editors that are able to install and use VSCode extensions, such as Cursor and Windsurf. + +You can use the extension on its own, or you can use it to complement your local development on a repository whose remote has CodeRabbit installed. + +The extension is intended to let you use the power of CodeRabbit to rapidly tune and tidy your code changes locally, before you publish your changes to your team's remote repository and start a more thorough code review. + +## Features + +The extension includes the following features: + +- Automatic code reviews on every local Git commit +- Manually requested reviews of local code changes +- Full compatibility with text editors derived from VSCode, including Cursor and Windsurf + +## Price and limitations + +This extension is free to install and use, and works with any tier of CodeRabbit account. Rate limits apply to the number of local reviews that you can request per hour. + +The extension makes only basic CodeRabbit review features available, with default settings applied. Advanced CodeRabbit features, such as interactive chat and project learnings, aren't available through the VSCode extension. These features are available only by [integrating CodeRabbit on your remote repository](/platforms), and then allowing CodeRabbit to review pull requests. + +## What's next + +- [Install the VSCode extension](/guides/install-vscode) +- [Use the VSCode extension](/guides/use-vscode) diff --git a/docs/guides/install-vscode.md b/docs/guides/install-vscode.md new file mode 100644 index 0000000..85e3e5e --- /dev/null +++ b/docs/guides/install-vscode.md @@ -0,0 +1,47 @@ +--- +title: Install the VSCode extension +description: How to install the CodeRabbit VSCode extension +--- + +This page is about installing the CodeRabbit VSCode extension. For more information about the extension, see +[Review local changes](/code-editors). + +:::note +The instructions on this page are specific to using the extension with VSCode. If you are instead using a VSCode-compatible editor such as Cursor or Windsurf, then the steps that you need to follow are similar, but might require some adaptation. +::: + +## Before you begin + +Before you can use the CodeRabbit VSCode extension, you need a CodeRabbit account. + +If you don't already have an account, you can create one by visiting [the CodeRabbit login page](https://app.coderabbit.ai/login). + +## Install the extension + +To install the CodeRabbit VSCode extension, follow these steps: + +1. Visit [the extension's page on the Visual Studio Marketplace](https://coderabbit.link/vscode-docs). + +1. Click **Install**. + +1. If your browser asks you for permission to open VSCode, then click **Allow** or its equivalent control. + +1. A summary of the CodeRabbit VSCode extension appears in your VSCode window. If you would like VSCode to automatically check for and apply future updates to the extension, then keep the **Auto Update** checkbox selected. + +1. In VSCode, click **Install**. + +1. A **Log in to CodeRabbit to get started** dialog appears. Click **Login**. If the dialog gets dismissed or times out first, then you can follow these alternate steps: + + 1. Click the CodeRabbit icon in the VSCode activity bar. + + 1. Click the **Use CodeRabbit for Free** button. + +1. Grant VSCode permission to open your browser, if asked. + +1. In your web browser, log into your CodeRabbit account. + +This connects your CodeRabbit account with the CodeRabbit VSCode extension. + +## What's next + +- [Use the VSCode extension](/guides/use-vscode) diff --git a/docs/guides/uninstall-vscode.md b/docs/guides/uninstall-vscode.md new file mode 100644 index 0000000..27266d4 --- /dev/null +++ b/docs/guides/uninstall-vscode.md @@ -0,0 +1,25 @@ +--- +title: Uninstall the VSCode extension +description: How to uninstall the CodeRabbit VSCode extension +--- + +This page is about uninstalling the CodeRabbit VSCode extension. For more information about the extension, see +[Review local changes](/code-editors). + +:::note +The instructions on this page are specific to using the extension with VSCode. If you are instead using a VSCode-compatible editor such as Cursor or Windsurf, then the steps that you need to follow are similar, but might require some adaptation. +::: + +## Uninstall the extension + +To uninstall the VSCode extension, follow these steps: + +1. In the VSCode activity bar, click the CodeRabbit icon. + +1. In the CodeRabbit sidebar, click the door-shaped **Logout** icon. + +1. In the VSCode activity bar, click the **Extensions** icon. + +1. In the Extensions sidebar, click the gear-shaped **Manage** icon next to CodeRabbit in the list of installed extensions. + +1. Select **Uninstall**. diff --git a/docs/guides/use-vscode.md b/docs/guides/use-vscode.md new file mode 100644 index 0000000..06c8aba --- /dev/null +++ b/docs/guides/use-vscode.md @@ -0,0 +1,93 @@ +--- +title: Use the VSCode extension +description: How to review your code with the VSCode extension. +--- + +This page is about performing local code reviews using the CodeRabbit VSCode extension. For more information about the extension, see +[Review local changes](/code-editors). To learn how to install the extension, see [Install the VSCode extension](/guides/install-vscode). + +The CodeRabbit VSCode extension works by comparing changes in your current, checked-out Git branch against another branch in your local repository. You can use the extension to automatically perform full-branch changes after every commit, or make different kinds of comparisons by manually requesting a review. + +:::note +The instructions on this page are specific to using the extension with VSCode. If you are instead using a VSCode-compatible editor such as Cursor or Windsurf, then the steps that you need to follow are similar, but might require some adaptation. +::: + +## Automatically review local commits + +You can let CodeRabbit automatically review commits that you make to your local Git repository. These automatic reviews compare all committed changes against the branch that your working branch is based on. + +To perform an automatic review, follow these steps: + +1. Perform a Git commit using VSCode. After you do this, a dialog appears in your VSCode window, asking **Would you like to start a review?** + +1. Click **Yes.** The CodeRabbit sidebar appears in your VSCode window. + +1. Wait for the review to complete. This might take a few minutes. To cancel a review in progress, click **Stop the review**. + +After the review completes, you can browse and respond to review comments as described in [Work with code reviews](#work-with-code-reviews). + +For more options and control of code reviews performed using the CodeRabbit VSCode extension, you can manually request a review, as detailed in the following section. + +## Manually request code reviews + +To manually review changes in a local Git branch using the CodeRabbit VSCode extension, follow these steps: + +1. Click the CodeRabbit icon in the VSCode activity bar. The CodeRabbit sidebar appears. + +1. If you want to compare your code changes to a branch other than its base branch, then follow these steps: + + 1. In the sidebar, under **Branch**, click the name of the base branch. A **Select a base branch** dialog appears, listing other branches in your local Git repository. + + 1. Select the name of a base branch to compare against. + +1. Select one of the review-action options from the menu at the bottom of the CodeRabbit sidebar: + + - To review all changes between the base branch and your current branch, including both committed and uncommitted changes, select **Review all changes**. This is the default selection. + + - To limit the review to only changes on your branch that you have committed, select **Review committed changes**. This includes commits that you have pushed to your remote repository, if any, as well as any local commits. + + - To limit the review to only uncommitted changes on your branch, select **Review uncommitted changes**. This includes both staged and unstaged changes. + +1. Refer to the list of **Files to review** in the sidebar. This list represents all of the files that the selected review action includes. To change this list of files, repeat the previous step to choose a different review action, or use Git features like `git stash` to selectively remove changes. + +1. To perform the review, click the button part of the menu. The CodeRabbit sidebar displays a **Review** section with the review's progress. + +1. Wait for the review to complete. This might take a few minutes. To cancel a review in progress, click **Stop the review**. + +After the review completes, you can browse and respond to review comments as described in the following section. + +## Work with code reviews + +The CodeRabbit VSCode extension presents code reviews as a series of actionable comments, connected to specific files and lines. It gives you tools to apply its suggestions quickly, when possible. + +### Browse comments + +After the extension finishes its review, it adds any comments to the CodeRabbit sidebar under the **Files** heading in the **Reviews** section. + +Each item in **Files** is a comment referring to one or more lines in that file. Click the comment to see a detailed, inline comment in the editor, attached to the appropriate file and lines. + +You can react to these comments however you want: you can apply their advice literally, or let them guide you to find alternate solutions, or ignore them entirely. CodeRabbit comments are metadata stored with VSCode, and are not part of your files. The presence of comments doesn't block your use of version control. + +### Apply suggested changes + +Whenever possible, the CodeRabbit VSCode extension attaches discrete change suggestion to comments in the form of code diffs. For example, if it detects a typo in a new function name, the extension might attach a diff with a suggested correction. + +If you agree with CodeRabbit about the suggested fix and want to apply to exactly as it proposes, click the checkmark-shaped **Apply suggested change** icon in the inline comment. The extension makes the change for you in the editor. + +### Ignore or collapse comments + +To remove a comment from the editor, click its **Ignore** icon. + +To remove a comment but keep an icon in the editor noting its presence, click its **Collapse** icon. + +To see an ignored or collapsed comment in the editor again, click its summary in the CodeRabbit sidebar. + +### Browse previous reviews + +If you have performed reviews prior to the most recent review in the current VSCode window, then you can browse the comments from these reviews under the **Previous reviews** heading in the CodeRabbit sidebar. + +If a past review comment no longer applies to the current state of your code, then clicking that comment won't display a detailed comment or suggestion in the editor. + +## What's next + +- [Uninstall the VSCode extension](/guides/uninstall-vscode) diff --git a/docs/overview/introduction.md b/docs/overview/introduction.md index ed73a15..0615097 100644 --- a/docs/overview/introduction.md +++ b/docs/overview/introduction.md @@ -94,8 +94,16 @@ Public repositories can use the Pro tier of CodeRabbit at no charge, including a For private repositories, a number of pricing tiers are available. These range from a Free tier that offers unlimited code-change summaries, to an Enterprise tier with access to advanced features and SLA support. For more information, see [Pricing](https://www.coderabbit.ai/pricing). +## Review local changes from within VSCode + +As a separate, free product, CodeRabbit offers a VSCode extension that brings a subset of core CodeRabbit features to VSCode. This lets you use the power of CodeRabbit to tune and tidy your code changes locally before pushing your changes into a formal pull request for more thorough reviews. + +For more information, see [Review local changes](/code-editors). + ## What's next - [Quickstart](/getting-started/quickstart/) lets you experience your first CodeRabbit code review first-hand. +- [Review local changes](/code-editors) guides you through installing and using a subset of CodeRabbit features directly from your code editor. + - [Why CodeRabbit?](/overview/why-coderabbit) dives further into the philosophies and technologies that drive CodeRabbit. diff --git a/sidebars.ts b/sidebars.ts index c6502d8..5c9cd91 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -108,6 +108,17 @@ const sidebars: SidebarsConfig = { "guides/linked-issues", ], }, + { + type: "category", + collapsed: false, + label: "Review local changes", + items: [ + "guides/about-vscode", + "guides/install-vscode", + "guides/use-vscode", + "guides/uninstall-vscode", + ], + }, { type: "category", collapsed: false,