Code Completion.
An AI feature that predicts and suggests the next tokens of code as a developer types, ranging from single-token suggestions to entire function implementations.
AI-powered code completion has evolved from simple token prediction (completing a variable name) to multi-line and whole-function generation. Tools like GitHub Copilot, Codeium, and Tabnine use large language models trained on code to predict what a developer is likely to write next given the surrounding context.
Modern code completion systems use fill-in-the-middle (FIM) training, where the model is trained to predict code given both the code before the cursor and the code after it. This bidirectional context awareness makes completions more accurate than systems that only look at what came before.
The quality of code completion depends heavily on context window usage: how much of the current file, related files, and imported modules the model can see. Tools that index the full repository (like Cursor) produce more relevant completions than those limited to the current file. Completion latency is also critical — slow completions break the typing flow and reduce adoption.