Use IDX AI inline

Project IDX boosts your productivity with AI-assisted code suggestions from IDX AI. Before you use any of the inline assistance from IDX AI, make sure you add IDX AI to your workspace.

To learn more, see Generative Code Assistance.

Get code suggestions from IDX AI

IDX AI generates complete blocks of possible code inline. To use the IDX AI inline code assistance, follow these steps:

  1. Open your IDX workspace. If you haven't already, add IDX AI to your workspace.

  2. Go to the file or line of code you want help with and press Cmd + I (on MacOS) or Ctrl + I (on Windows/ChromeOS/Linux).

  3. Enter a description of what you want and IDX AI generates a suggestion. You can also use actions as shortcuts to guide the suggestions. For example, enter /fixError for help fixing errors in inline code.

  4. To keep the generated code, click Accept. To paste the suggestion somewhere else or move it to a new file, select the corresponding option from the drop-down menu on the Discard button. To generate a new suggestion, click the Regenerate icon. To remove the suggestion completely, click Discard.

View IDX AI commands inline

  1. To view IDX AI commands inline, for specific code, select and right-click the code you want help with.

  2. Select IDX AI from the menu and then select the action you want to perform.

Use IDX AI suggested code completion

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.