dev-tools

Code Completion

Code completion is the feature that predicts and suggests what a developer is about to type — anything from finishing a variable name to generating an entire function body. Traditional code completion (sometimes called IntelliSense, after Microsoft's implementation) is driven by static analysis: the IDE knows the type of an object and offers only its valid methods and properties. Modern AI-powered code completion, popularized by GitHub Copilot in 2021, replaces or augments this with an LLM trained on billions of lines of public code, which predicts plausible next tokens based on the surrounding file, open tabs, and sometimes the whole repository as context. Why it matters for builders: it's the highest-frequency AI touchpoint in a developer's day — accepted many times per minute rather than once per conversation — so its latency and accuracy compound heavily into perceived productivity. Poor completions (verbose, off-pattern, or subtly buggy) create "review tax" that can outweigh the time saved. How it works: as you type, the editor sends the current file (and often nearby open files or repo-wide embeddings) to a completion model, which returns a ranked suggestion shown as greyed-out "ghost text." Pressing Tab accepts it; continuing to type ignores it. Modern tools like Copilot and Cursor also do "next edit prediction" — guessing not just what you'll type next, but where else in the file you're likely to make a related edit. Worked example: a developer writing a Python function starts typing `def calculate_discount(price, customer_tier):` and presses Enter. The AI completion engine, having seen similar tiered-pricing logic elsewhere in the repo, suggests: `if customer_tier == "gold": return price * 0.8` followed by `elif customer_tier == "silver": return price * 0.9` and a default `return price`. The developer accepts the first two lines with Tab, rejects the assumed 0.9 discount by typing `0.85` instead (the ghost text updates to match), and accepts the rest. The whole function is drafted in under five seconds versus a minute or two of manual typing, and because the suggestion pulled its logic directly from a sibling function in the same repo, the resulting code style matches the surrounding codebase far more closely than a generic autocomplete trained only on public code ever could. Latency matters enormously here too — a completion that takes 800 milliseconds to appear disrupts a developer's flow far more than one that appears in 100 milliseconds, which is why completion providers invest heavily in fast, lightweight models for this specific use case rather than routing every keystroke through the largest, slowest model available.

Related terms

More Dev Tools terms