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:
- The suggested code follows generic standard practices and might not be tailored to the project’s specific needs. Always review and understand the code before integrating it into your project.
- Code completion assistants may have shorter context windows, and so might not include all relevant earlier code in the context window, leading to it missing out important information when generating code. Always check that the code is what you would have written.
- The code completion assistant may have misunderstood some variable names (especially if proper variable names were not used), leading to obscure/tricky logic bugs. Follow coding best practices so that code completion assistants can better understand written code and generate correct code.
- The coding assistant cannot run the generated code and thus cannot predict any bugs that might occur. Always test the code yourself.
- Code completion assistants often rely on tricks to shorten the amount of context needed, e.g. by selectively including only certain files in the context, or by ignoring code after the cursor. For best results, you may have to make some code modifications to bring relevant code into the context.
- Code completion assistants are best used for repetitive, standard boilerplate code. For other use cases, exercise extra caution.
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:

This will install the GitHub Copilot Chat extension.
Ensure that the options in Inline Suggestions are enabled in the GitHub Copilot Chat 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.