code completion
Code completion is an assistive function that suggests probable continuations of code while programming, so the developer does not need to type everything letter by letter.
In plain terms
If you have ever sent a message on your phone, you know the feeling: the keyboard suggests the next word, and you accept it with a tap. Code completion is the same, but for programmers: the editor program faintly displays what it thinks comes next while you type, and you can insert it with a keystroke.
It used to only complete names and commands, like a smart dictionary. Today's AI-based version suggests entire lines and even whole blocks of code, because the language model learned from a huge amount of previously written code what usually comes next.
The key point is that you are in charge: you write the program, and the machine only suggests. This differs from a coding agent, which independently completes a given task in multiple steps while you only verify the final result.
How it works
- The editor continuously monitors where the cursor is and what you typed before and after it.
- It sends this environment (a part of the open file, often details from other project files) to a language model trained on code.
- The model calculates the most likely continuation and typically returns one or more suggestions in a fraction of a second.
- The suggestion appears as faint, grey text near the cursor: you can accept it (typically with the Tab key), rewrite it, or simply keep typing, causing it to disappear.
- Many tools also measure which suggestions users accept, and the creators refine the next version based on these, depending on the settings.
An everyday example
An online store developer starts writing the program part that calculates the cart total with VAT. As soon as they type the function name, the editor suggests the full calculation; they read it through, correct the VAT rate, and accept it.
Who is affected
A common misconception
Limits and risks
- The suggestion may appear confident even if it is incorrect: it may reference a non-existent function or hide a logical error.
- It could have learned from bad examples, so it may sometimes recommend solutions containing security vulnerabilities.
- Most tools send part of your code to the provider's server, so for confidential or corporate code, check the settings and terms of service.
- It only sees what the editor sends it: it does not know the full system architecture or the business intent.
Similar, but not the same
- coding agent – A coding agent independently plans, modifies files, and runs tests to complete a task, whereas code completion only suggests where you are currently typing.
- code generation – In code generation, a full program section is created in response to a text request, while code completion continues already started code without a request.
- automatic text completion – It suggests continuations for everyday texts (messages, emails, searches), while code completion does the same for program code, using a model trained on code or based on programming language rules.
Related concepts
AI-based programming assistant, generative AI, software development
line completion, multi-line code suggestion, next-edit prediction
A brief history
Simple code completion already existed in developer tools of the 1980s. The traditional version, based on programming language rules, became widely known in the second half of the 1990s when Microsoft integrated it into its developer tools under the name IntelliSense from 1996. The AI-based version, which suggests entire lines and program sections, spread massively with GitHub Copilot, introduced in preview in 2021 and available to everyone from 2022.
Where things stand
By the end of 2026, AI-based code completion became a basic feature in most developer editors. Attention meanwhile shifted to coding agents, which already perform entire tasks, while completion became a familiar background tool.
Also known as
code completion · code completion · automatic code completion · autocomplete · intelligent code completion · AI code completion · code suggestion · tab completion
Sources
- Chen et al. (2021): Evaluating Large Language Models Trained on Code (arXiv)
- Wikipedia: GitHub Copilot
This entry was machine-edited and has undergone machine expert review; the “In the news” section updates automatically from Agent Age stories.