---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md
  - https://sourcecraft.dev/portal/docs/ru/code-assistant/operations/quick-actions.md
title: Quick actions in SourceCraft Code Assistant
description: How to use quick actions in Code Assistant.
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt


# Quick actions in SourceCraft Code Assistant

<!-- source: en/_includes/code-assistant/quick-actions-description.md -->
For your convenience with the plugin, there are _quick actions_, i.e., Code Assistant integrations with your IDE.

The following integrations are available for **Visual Studio Code**:
* _Lightbulb_: Menu you access by clicking <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><g fill="currentColor"><path fill-rule="evenodd" d="M6.26 15.109a4 4 0 0 0 3.48 0l.13-.063a2 2 0 0 0 1.13-1.8v-.468c0-1.352.776-2.557 1.54-3.673a5.5 5.5 0 1 0-9.08 0C4.224 10.221 5 11.426 5 12.779v.467a2 2 0 0 0 1.13 1.801zm2.828-1.35.13-.064a.5.5 0 0 0 .282-.45v-.467q0-.255.025-.5a5.33 5.33 0 0 1-3.05 0q.024.245.025.5v.467a.5.5 0 0 0 .282.45l.13.063a2.5 2.5 0 0 0 2.176 0m-4.39-5.501c.394.576.891 1.302 1.263 2.148a3.79 3.79 0 0 0 4.078 0c.372-.846.869-1.572 1.264-2.148a4 4 0 1 0-6.605 0" clip-rule="evenodd"/><path d="M8 3.5A.75.75 0 0 0 8 5a1 1 0 0 1 1 1 .75.75 0 0 0 1.5 0A2.5 2.5 0 0 0 8 3.5"/></g></svg> next to the code blocks and can use to generate [docs](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#docs) and [tests](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#test).
* _CodeLens_: Buttons above the code blocks you can use to generate docs and tests and [set up actions displayed in codelenses and lightbulbs](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#set-actions).
* _Context menu_: Right-click menu you can use to generate docs and tests, [send selected code to the chat](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#send-to-chat), request code [autocompletion](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#autocompletion)/[improvements](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#provide-improvements), or [generate a commit message](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#commit) in the [Git](https://git-scm.com/) version control system.
* _Slash (/) commands_: You can use the <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="m7.836 6 .76-2.027L9.336 2H5.5a.72.72 0 0 0-.664.45L2.513 8.257a.177.177 0 0 0 .164.243h4.965l-.732 2.013-1.082 2.975a.382.382 0 0 0 .637.392l6.956-7.391A.29.29 0 0 0 13.21 6H7.835m2.727-3 .235-.627A1.386 1.386 0 0 0 9.5.5h-4c-.906 0-1.72.552-2.057 1.393L1.12 7.7A1.677 1.677 0 0 0 2.677 10H5.5l-.545 1.5-.537 1.475a1.882 1.882 0 0 0 3.14 1.933l6.956-7.391A1.79 1.79 0 0 0 13.21 4.5H10z" clip-rule="evenodd"/></svg> **Slash Commands** selector in the chat toolbar to request [text generation](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#test) or [code improvement](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#provide-improvements) for the file opened in the editor, [generate a commit message](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#commit) in the [git](https://git-scm.com/) version control system, and invoke [AI code review](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/quick-actions.md#review).

For **JetBrains IDEs**, there are codelenses that can generate docs and tests.
<!-- endsource: en/_includes/code-assistant/quick-actions-description.md -->

{% note warning %}

You can tailor the quick actions prompt to your project's requirements. In the chat's top panel, click **Settings** and edit your prompt in the <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" stroke-linejoin="round" stroke-width="1.5" d="M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5H8l-3.5 2.5V11h-1a.5.5 0 0 1-.5-.5v-7Z"/></svg> **Quick Actions** section, adding project-specific guidelines.

{% endnote %}

<!-- source: en/_includes/code-assistant/ide-function-difference.md -->
Functionality varies depending on the IDE you are using.
<!-- endsource: en/_includes/code-assistant/ide-function-difference.md -->

<!-- source: en/_includes/code-assistant/vscode-ui-language.md -->
{% note info %}

The interface language of the Visual Studio Code plugin depends on the selected IDE language.

{% endnote %}
<!-- endsource: en/_includes/code-assistant/vscode-ui-language.md -->

## AI code review {#review}

<!-- source: en/_includes/code-assistant/only-in-vscode.md -->
{% note warning %}

This feature is only available in Visual Studio Code.

{% endnote %}
<!-- endsource: en/_includes/code-assistant/only-in-vscode.md -->

Only the [Git](https://git-scm.com/) version control system is supported.

{% list tabs group=ide %}

- Visual Studio Code {#vscode}

  1. <!-- source: en/_includes/code-assistant/open-chat-vsc.md -->
     Click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#868686" d="M21 23H2l.9-4.5h1.53l-.6 3h15.94l1.2-6H21L22.5 8H24l-3 15Zm-2.75-7h-6l-3.375 3L7 16H0L3 1h18.25l-3 15ZM1.83 14.5h6l.441.705.934 1.493 2.048-1.82.426-.378h5.34l2.4-12H4.23l-2.4 12Zm7.17-2H7l5.5-8h2l-5.5 8Z"/></svg> **SourceCraft Code Assistant** in the editor’s left panel.

     If you have many plugins, the chat button may be hidden in the <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m5 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" clip-rule="evenodd"/></svg> menu.

     Alternatively, use **Ctrl** + **L** in Windows/Linux or **Command** + **L** in macOS.
     <!-- endsource: en/_includes/code-assistant/open-chat-vsc.md -->
  1. In the message input window, click <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="m7.836 6 .76-2.027L9.336 2H5.5a.72.72 0 0 0-.664.45L2.513 8.257a.177.177 0 0 0 .164.243h4.965l-.732 2.013-1.082 2.975a.382.382 0 0 0 .637.392l6.956-7.391A.29.29 0 0 0 13.21 6H7.835m2.727-3 .235-.627A1.386 1.386 0 0 0 9.5.5h-4c-.906 0-1.72.552-2.057 1.393L1.12 7.7A1.677 1.677 0 0 0 2.677 10H5.5l-.545 1.5-.537 1.475a1.882 1.882 0 0 0 3.14 1.933l6.956-7.391A1.79 1.79 0 0 0 13.21 4.5H10z" clip-rule="evenodd"/></svg> and select:
      * **Neouroreview: Diff with Current Branch** <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M12.5 12.618c.307-.275.5-.674.5-1.118V6.977a1.5 1.5 0 0 0-.585-1.189l-3.5-2.692a1.5 1.5 0 0 0-1.83 0l-3.5 2.692A1.5 1.5 0 0 0 3 6.978V11.5A1.496 1.496 0 0 0 4.493 13H5V9.5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2V13h.507c.381-.002.73-.146.993-.382m2-1.118a3 3 0 0 1-3 3h-7a3 3 0 0 1-3-3V6.977A3 3 0 0 1 2.67 4.6l3.5-2.692a3 3 0 0 1 3.66 0l3.5 2.692a3 3 0 0 1 1.17 2.378zm-5-2A.5.5 0 0 0 9 9H7a.5.5 0 0 0-.5.5V13h3z" clip-rule="evenodd"/></svg>: To review differences with the current branch.
      * **Neouroreview: Diff with Main Branch** <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M12.5 12.618c.307-.275.5-.674.5-1.118V6.977a1.5 1.5 0 0 0-.585-1.189l-3.5-2.692a1.5 1.5 0 0 0-1.83 0l-3.5 2.692A1.5 1.5 0 0 0 3 6.978V11.5A1.496 1.496 0 0 0 4.493 13H5V9.5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2V13h.507c.381-.002.73-.146.993-.382m2-1.118a3 3 0 0 1-3 3h-7a3 3 0 0 1-3-3V6.977A3 3 0 0 1 2.67 4.6l3.5-2.692a3 3 0 0 1 3.66 0l3.5 2.692a3 3 0 0 1 1.17 2.378zm-5-2A.5.5 0 0 0 9 9H7a.5.5 0 0 0-.5.5V13h3z" clip-rule="evenodd"/></svg>: To review differences with the main branch.

      You can also right-click in the editor to open the context menu and select **AI code review**.

  **AI code review** will intellectually analyze the code changes using information from `git diff`, and suggest some constructive improvements. You can invoke AI code review to analyze the differences between your code and either the **current branch** or the **main branch**.

{% endlist %}

## Generating tests {#test}

{% list tabs group=ide %}

- Visual Studio Code {#vscode}

  In the codelens or lightbulb next to the code section you want to generate tests for, click **SourceCraft Code Assistant: Generate Tests**.

  Alternatively, you can right-click within the code section for which you want to generate tests and select **SourceCraft Code Assistant** → **Generate Tests**.

  The generated tests will appear in a new chat.

- JetBrains IDE {#jb}

  Above the code section you want to generate tests for, click **SourceCraft Code Assistant: Generate Tests**.

  The generated tests will appear in a new chat.

{% endlist %}

## Generating docs {#docs}

{% list tabs group=ide %}

- Visual Studio Code {#vscode}

  In the codelens or lightbulb next to the code section you want to generate docs for, click **SourceCraft Code Assistant: Generate Docs**.

  Alternatively, you can right-click within the code section for which you want to generate docs and select **SourceCraft Code Assistant** → **Generate Docs**.

  The docs will be suggested in the form of a code section comment. To accept or reject the comment, click **Accept** (**Ctrl** + **Y** in Windows/Linux or **Command** + **Y** in macOS) or **Reject** (**Ctrl** + **N** in Windows/Linux or **Command** + **N** in macOS).

- JetBrains IDE {#jb}

  Above the code section you want to generate docs for, click **SourceCraft Code Assistant: Generate Docs**.

  The generated docs will appear in a new chat.

{% endlist %}

## Refactoring code {#provide-improvements}

<!-- source: en/_includes/code-assistant/only-in-vscode.md -->
{% note warning %}

This feature is only available in Visual Studio Code.

{% endnote %}
<!-- endsource: en/_includes/code-assistant/only-in-vscode.md -->

{% list tabs group=ide %}

- Visual Studio Code {#vscode}

  1. <!-- source: en/_includes/code-assistant/open-chat-vsc.md -->
     Click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#868686" d="M21 23H2l.9-4.5h1.53l-.6 3h15.94l1.2-6H21L22.5 8H24l-3 15Zm-2.75-7h-6l-3.375 3L7 16H0L3 1h18.25l-3 15ZM1.83 14.5h6l.441.705.934 1.493 2.048-1.82.426-.378h5.34l2.4-12H4.23l-2.4 12Zm7.17-2H7l5.5-8h2l-5.5 8Z"/></svg> **SourceCraft Code Assistant** in the editor’s left panel.

     If you have many plugins, the chat button may be hidden in the <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m5 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" clip-rule="evenodd"/></svg> menu.

     Alternatively, use **Ctrl** + **L** in Windows/Linux or **Command** + **L** in macOS.
     <!-- endsource: en/_includes/code-assistant/open-chat-vsc.md -->
  1. In the message input window, click <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="m7.836 6 .76-2.027L9.336 2H5.5a.72.72 0 0 0-.664.45L2.513 8.257a.177.177 0 0 0 .164.243h4.965l-.732 2.013-1.082 2.975a.382.382 0 0 0 .637.392l6.956-7.391A.29.29 0 0 0 13.21 6H7.835m2.727-3 .235-.627A1.386 1.386 0 0 0 9.5.5h-4c-.906 0-1.72.552-2.057 1.393L1.12 7.7A1.677 1.677 0 0 0 2.677 10H5.5l-.545 1.5-.537 1.475a1.882 1.882 0 0 0 3.14 1.933l6.956-7.391A1.79 1.79 0 0 0 13.21 4.5H10z" clip-rule="evenodd"/></svg> and select **Refactor code**.

  You can also use the editor: right-click to open the context menu and select **SourceCraft Code Assistant** → **Refactor code**.

  The refactored code and explanations will appear in the chat.

{% endlist %}

## Sending a code section to a chat {#send-to-chat}

<!-- source: en/_includes/code-assistant/only-in-vscode.md -->
{% note warning %}

This feature is only available in Visual Studio Code.

{% endnote %}
<!-- endsource: en/_includes/code-assistant/only-in-vscode.md -->

{% list tabs group=ide %}

- Visual Studio Code {#vscode}

  1. Select the code section.
  1. Right-click to open the context menu and select **SourceCraft Code Assistant** → **Add Selection to Chat**.

      Alternatively, you can use **Ctrl** + **I** in Windows/Linux or **Command** + **I** in macOS.

{% endlist %}

## Generating a commit message {#commit}

<!-- source: en/_includes/code-assistant/only-in-vscode.md -->
{% note warning %}

This feature is only available in Visual Studio Code.

{% endnote %}
<!-- endsource: en/_includes/code-assistant/only-in-vscode.md -->

Only the [Git](https://git-scm.com/) version control system is supported.

{% list tabs group=ide %}

- Visual Studio Code {#vscode}

  1. <!-- source: en/_includes/code-assistant/open-chat-vsc.md -->
     Click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#868686" d="M21 23H2l.9-4.5h1.53l-.6 3h15.94l1.2-6H21L22.5 8H24l-3 15Zm-2.75-7h-6l-3.375 3L7 16H0L3 1h18.25l-3 15ZM1.83 14.5h6l.441.705.934 1.493 2.048-1.82.426-.378h5.34l2.4-12H4.23l-2.4 12Zm7.17-2H7l5.5-8h2l-5.5 8Z"/></svg> **SourceCraft Code Assistant** in the editor’s left panel.

     If you have many plugins, the chat button may be hidden in the <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m5 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" clip-rule="evenodd"/></svg> menu.

     Alternatively, use **Ctrl** + **L** in Windows/Linux or **Command** + **L** in macOS.
     <!-- endsource: en/_includes/code-assistant/open-chat-vsc.md -->
  1. In the message input window, click <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="m7.836 6 .76-2.027L9.336 2H5.5a.72.72 0 0 0-.664.45L2.513 8.257a.177.177 0 0 0 .164.243h4.965l-.732 2.013-1.082 2.975a.382.382 0 0 0 .637.392l6.956-7.391A.29.29 0 0 0 13.21 6H7.835m2.727-3 .235-.627A1.386 1.386 0 0 0 9.5.5h-4c-.906 0-1.72.552-2.057 1.393L1.12 7.7A1.677 1.677 0 0 0 2.677 10H5.5l-.545 1.5-.537 1.475a1.882 1.882 0 0 0 3.14 1.933l6.956-7.391A1.79 1.79 0 0 0 13.21 4.5H10z" clip-rule="evenodd"/></svg> and select **Commit description**.

  You can also use the editor: right-click to open the context menu and select **SourceCraft Code Assistant** → **Commit description**.

  You will see a change summary and commit message in a new chat.

{% endlist %}

## Setting up actions displayed in code lenses and lightbulbs {#set-actions}

<!-- source: en/_includes/code-assistant/only-in-vscode.md -->
{% note warning %}

This feature is only available in Visual Studio Code.

{% endnote %}
<!-- endsource: en/_includes/code-assistant/only-in-vscode.md -->

{% list tabs group=ide %}

- Visual Studio Code {#vscode}

  1. In the codelens above the code section, click <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3.47 3.47a.75.75 0 0 1 1.06 0L8 6.94l3.47-3.47a.75.75 0 1 1 1.06 1.06L9.06 8l3.47 3.47a.75.75 0 1 1-1.06 1.06L8 9.06l-3.47 3.47a.75.75 0 0 1-1.06-1.06L6.94 8 3.47 4.53a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/></svg>.
  1. In the settings window that opens, select which actions should appear in codelenses and which in lightbulbs. 

{% endlist %}

## Invoking code autocompletion {#autocompletion}

<!-- source: en/_includes/code-assistant/only-in-vscode.md -->
{% note warning %}

This feature is only available in Visual Studio Code.

{% endnote %}
<!-- endsource: en/_includes/code-assistant/only-in-vscode.md -->

{% list tabs group=ide %}

- Visual Studio Code {#vscode}

  1. Position the cursor to where you want to invoke autocompletion.
  1. Right-click to open the context menu and select **SourceCraft Code Assistant** → **Suggest code**.

Alternatively, you can use **Ctrl** + **Enter**.

{% endlist %}

#### Useful links {#see-also}

* [Getting started with SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/code-assistant/index.md)
* [SourceCraft Code Assistant overview](https://sourcecraft.dev/portal/docs/en/code-assistant/concepts/index.md)
* [SourceCraft Code Assistant chat interface in the JetBrains IDE](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/chat.md)