Getting the most from inline actions

This feature is currently available for VS Code and JetBrains IDEs. Support for Visual Studio 2022 and Eclipse is coming soon.

Note, inline actions is currently available for Tabnine SaaS customers (Pro, Enterprise SaaS and Basic users who have AI Chat access). Support for Tabnine Enterprise self hosted is coming soon.

Inline actions allow you to work directly on selected snippets of code — getting AI-enabled edits, fixes, refactoring, documentation, and more — with all responses generated inline. Additionally, you can use inline actions to generate code directly at your cursor’s location inside the code editor.

Inline actions brings together the best of our AI chat and code completions into a single interface. By delivering AI-generated code or edits within the same environment where you’re working, inline actions are a faster and easier method to create, refine, document, and fix code. Inline actions enable you to stay in the flow by offering an intuitive way of using Tabnine.

Getting started with inline actions

Inline actions are embedded in VS Code and the JetBrains family of IDEs (support for other IDEs to come soon). Trigger inline actions by clicking Edit in the code lens functionality (in VS Code), or by using the ⌘ + I (Ctrl + I for Windows and Linux) keyboard shortcut. These actions open up a Tabnine-specific command palette containing an array of commands.

You can enter instructions for your task in natural language or choose from the available quick commands. We support /fix-code, /document-code, /explain-code, and /code-explore quick commands. The responses for /fix-code and /document-code are generated inline, whereas the responses for /explain-code and /code-explore quick commands are generated in the AI chat panel. This is because the answers to these tasks are typically not needed in the code files. Therefore, when using inline actions for /explain-code and /code-explore commands, we provide the responses in the AI chat panel, making it easier to consume them.

Inline actions support the mentions (using the @ symbol) capability and allow you to include a specific code element (type, method, or class) from the workspace in the prompt. Inline actions also leverage your context to deliver optimized recommendations for your use case — accessing locally available code and information in your IDE and (for Enterprise users) your organization’s global codebases to generate responses tailored to you and your organization.

You can specify the scope for your question — select a few lines of code or a code block that you want to edit, or inform Tabnine to generate the response at the cursor location.

Inline actions also benefit from Tabnine’s switchable models. Select the best model for your use case or corporate requirements, choosing from Tabnine’s custom-developed models (Tabnine Protected 2, Tabnine + Mistral) or from popular models from third parties (Command R+, Claude 3.5 Sonnet, GPT-4o, and Codestral). Note that the model selection persists across AI chat and inline actions. For example, if you select Claude 3.5 Sonnet as your model in the AI chat, then inline actions also uses Claude 3.5 Sonnet.

After you specify what you want to accomplish using inline actions and hit Enter (Command + Enter, or Ctrl + Enter for JetBrains IDEs), Tabnine provides inline responses along with a diff view that makes it easy to determine the suggested changes. You can accept (by clicking Alt + A) or discard the response (by clicking Alt + R) — after you accept, Tabnine inserts the response inline.

What you can do with inline actions

Generate new code inline

Simply click the ⌘ + I keyboard shortcut (Ctrl + I for Windows and Linux) to trigger inline actions. Type in natural language the instructions for creating new code and hit Enter. Tabnine generates the code and offers responses right where your cursor is. Review the suggestions quickly with the diff view, and hit Alt+A to accept the response.

Fix code with inline actions

Click Edit in the code lens to open the inline actions command palette. Select the /fix-code command (or type in natural language) and hit Enter. Tabnine fixes the code and generates the response inline. Review quickly with the diff view and accept the changes.

Create inline documentation

Use the ⌘ + I keyboard shortcut (Ctrl + I for Windows and Linux) to trigger inline actions. Type in natural language to create inline documentation (or use the /document-code quick command) and hit Enter. Tabnine generates inline responses — review and accept changes by hitting Alt + A.

Edit code with inline actions

Select the code, trigger inline actions using the ⌘+I keyboard shortcut (Ctrl + I for Windows and Linux) , and enter instructions for making modifications in natural language. Once you hit Enter, Tabnine generates inline responses — review them quickly and accept (using Alt + A) or reject (using Alt + R).

Keyboard shortcuts

  • Trigger inline actions: ⌘ + I (Ctrl + I for Windows and Linux)

  • Accept response: Opt + A (Alt + A)

  • Reject response: Opt + R (Alt + R)

Last updated