Quick actions in SourceCraft Code Assistant

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:

For JetBrains IDEs, there are codelenses that can generate docs and tests.

Functionality varies depending on the IDE you are using.

Note

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

Generating tests

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 AssistantGenerate Tests.

The generated tests will appear in a new chat.

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.

Generating docs

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 AssistantGenerate 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).

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.

Refactoring code

This feature is only available in Visual Studio Code.

  1. Select the code section you need refactored.
  2. Right-click to open the context menu and select SourceCraft Code AssistantRefactor code.

The refactored code and explanations will appear in a new chat.

Sending a code section to a chat

This feature is only available in Visual Studio Code.

  1. Select the code section.

  2. Right-click to open the context menu and select SourceCraft Code AssistantAdd Selection to Chat.

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

Generating a commit message

This feature is only available in Visual Studio Code.

Only the Git version control system is supported.

In the editor, right-click to open the context menu and select SourceCraft Code AssistantCommit Description.

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

Setting up actions displayed in code lenses and lightbulbs

This feature is only available in Visual Studio Code.

  1. In the codelens above the code section, click .
  2. In the settings window that opens, select which actions should appear in codelenses and which in lightbulbs.

Invoking code autocompletion

This feature is only available in Visual Studio Code.

  1. Position the cursor to where you want to invoke autocompletion.
  2. Right-click to open the context menu and select SourceCraft Code AssistantSuggest code.

See also

Previous