Code Completion

AI Assistant has the ability to insert LLM generated, context-aware code completion, while typing.

To generate relevant completions, the LLM request may include:

  • Contents of the current file

  • Type dependencies from other files

  • Recently opened files

To enable / disable code completions:

  • Open VS Code Settings using Ctrl+, and check / uncheck DVT ‣ AI ‣ Code Completion ‣ Enabled

  • Open Eclipse Preferences using Window ‣ Preferences and check / uncheck DVT ‣ AI Assistant ‣ Insert “Show AI Assistant Code Completions …” in the ‘default’ content assist list

To trigger code completion automatically in VS Code, start typing in the editor pausing briefly to wait for the inline suggestions to appear. To trigger it manually, run the DVT AI: Trigger Code Completion command.

../../_images/ai-code-completion-vscode.png

In Eclipse, use the Content Assist Ctrl+Space and select Show AI Assistant Code Completions… to request code completions from the LLM. Once generated, one or more suggestions will be displayed.

../../_images/ai-code-completion-eclipse-1.png
../../_images/ai-code-completion-eclipse-2.png

Note

To customize the code completion prompt, run the DVT AI: Edit Code Completion Blueprint command and modify the generated blueprint.