Get code help with Gemini

Project IDX facilitates your development workflows with the following AI-assisted code features:

  • Suggested code completion as you type.

  • Chat assistant sidebar that generates, translates, and explains code.

  • Inline actions that you can take on selected pieces of code. For example, you can ask Gemini in IDX to make the selected code more readable.

  • Inline code assistance.

To learn more, see Generative Code Assistance.

Add Gemini to your workspace

Gemini in IDX is available in limited regions, with availability expanding regularly. If Gemini in IDX is available in your region, you can add it to your workspace following these steps:

  1. Open Project IDX.

  2. Click the Gemini icon at the bottom of the workspace or press Cmd+Shift+Space (Ctrl+Shift+Space on ChromeOS, Windows or Linux). The Gemini chat sidebar appears. Be sure to click Learn more and read about Generative Code Assistance.

  3. Read through and accept the terms and conditions and Gemini in IDX privacy notice. Click Continue.

  4. Use Gemini in IDX to boost your coding productivity through the chat sidebar or inline code assistance.

  5. (Optional) For better customization and more helpful responses, turn on codebase indexing in your workspace settings. Open the Settings window by clicking the gear icon or pressing Ctrl + , (on Windows/Linux/ChromeOS) or Cmd + , (on MacOS) and select the IDX › AI: Enable Codebase Indexing option. If you use a settings.json file, set "IDX.aI.enableCodebaseIndexing": true.

To view Gemini in IDX commands from the command palette, open the command palette (Cmd+Shift+P on Mac or Ctrl+Shift+P on ChromeOS, Windows, or Linux) and search for Gemini. A list of Gemini in IDX commands appears.

Adjust your code completion settings

To help you write code, IDX provides AI-enabled suggested code completion that predicts and autofills code in any open file as soon as you begin to type. Suggested code completion is turned on by default.

To accept a code suggestion, press Tab. To ignore the suggestion, just keep typing.

To toggle code completion on or off, adjust your code completion settings.

  1. Open the Settings window by clicking the gear icon or pressing Ctrl + , (on Windows/Linux/ChromeOS) or Cmd + , (on MacOS).

  2. Search for the IDX > AI > Enable Inline Completion setting in the Workspace settings.

  3. To turn off code completion, deselect the Enable inline code completion as you type option. You have to update code completion settings for each of your workspaces.

    If you use a settings.json file, set "IDX.aI.enableInlineCompletion": false.

You can adjust this option under both the Workspace and User settings, but adjusting it in the Workspace settings ensures that the setting persists if the VM your workspace is connected to restarts. In IDX, User settings don't apply across your workspaces.

View code citations

To help you verify the code suggestions, IDX shares information about the original source and associated licenses. When you create code or accept inline code suggestions, IDX checks for licensed content and provides inline links to possible citations. Click these links to learn about potential software licensing requirements.

You can also see a log of all code citations and licenses in the Gemini chat window by clicking the License Log icon in the chat header bar.

License log icon in the chat header bar

To learn more about Google code citations, see Generative Code Assistance.

Next steps