nanyang-system-developers

Code Completion Assistants

Overview

AI-based code completion assistants use machine learning models to suggest code completions, improve developer productivity, and reduce coding errors. These features are usually provided in code editors or IDEs.

Cautionary measures

When using the autocomplete suggestions generated by code completion assistants, keep in mind that:

Using code completion in VS Code & GitHub Codespaces

In VS Code and GitHub Codespaces, complete Copilot setup to use auto-completion. If Copilot in the status bar says “Finish Setup”, click on it, then click Use AI Features:

The Finish Setup popup in VS Code

This will install the GitHub Copilot Chat extension.

Ensure that the options in Inline Suggestions are enabled in the GitHub Copilot Chat settings:

Inline Suggestions in Copilot settings

Code completions appear in dimmer text as you type. To accept the suggestion, press Tab or Right Arrow. To see more suggestions, press Ctrl + Space (or Cmd + Space on Mac) to open the suggestion list.

This can interfere with your typing, especially if you were intending to indent code with Tab. To cancel the suggestion, press Esc or keep typing to ignore it. You can also disable inline suggestions in the settings if you prefer to only use the suggestion list.