How AI Coding Assistants Use Code Context: LSP, ASTs, Search, and Retrieval

In the previous post, the important idea was that an editor is not a magical code mind… Visual Studio, VS Code, Neovim, and Emacs know how to display files and react to cursor positions. The deeper code knowledge usually lives in language services: parsers, syntax trees, symbol tables, type checkers, diagnostics, caches, and sometimes language servers speaking LSP. That explains how an editor can answer precise questions: what symbol is under the cursor? where is it defined? what type does this expression have? which references should change during a rename? where should this diagnostic squiggle appear? AI coding assistants start from a different place. ...

August 11, 2026 · Giulia

How Visual Studio Understands Your Code: LSP, Syntax Trees, and Language Services Behind the Curtain

Autocomplete feels like the editor understands the code.🙂 Visual Studio, VS Code, Neovim, and Emacs know about files, tabs, selections, cursor positions, and how to draw the UI. The deeper language knowledge lives in a separate language layer: sometimes an integrated IDE service, sometimes an external language server process. That language layer is the part that parses code, tracks names, builds semantic information, and answers questions like: what is under the cursor? where is this function defined? which completions are valid here? is this variable unused? what edit would safely rename this symbol? The editor asks, and the language layer answers: when that layer is an external process speaking a standard protocol, the protocol is often the Language Server Protocol, or LSP. So LSP is the message format that lets an editor talk to the language-specific system that has the intelligence. ...

August 5, 2026 · Giulia