liveBook · Manning

Ghost text

As explained in LLMs in Production

Ghost text is provisional text rendered inline in an editor as a preview of a suggested completion before the user accepts it.

Ghost text is provisional text rendered inline at the cursor as a preview of a generated completion. Users can accept it with Tab or reject it through another editor action, keeping suggestions visible without inserting them immediately. section 10.3

In a coding copilot, a VS Code inline completion provider supplies the preview. It receives the document, cursor position, invocation context, and cancellation token, then can return one or more completion items. A practical implementation limits generation to manual triggers, sends selected text to an LLM service, and returns the response at the selection’s end. section 10.3

Manual code suggestion

A user highlights code, presses Alt+S, and previews the LLM-generated continuation as inline text. The extension returns one suggestion and registers the provider for Python files or broader language patterns. section 10.3

How LLMs in Production covers it

How deep it goes
Explains provider registration, trigger handling, selection retrieval, and response placement without detailing completion-ranking internals.
Examples
Uses an Alt+S trigger, highlighted editor text, a generated response, and a Python-scoped inline provider.
What it assumes
Assumes familiarity with VS Code extensions, JavaScript, editor selections, and an accessible LLM endpoint.
What you can do after
Build it from scratch as a VS Code extension that previews manually triggered LLM completions.
How it connects
Connects inline completion providers with VS Code APIs, keybindings, selected text, and LLM services.

This explainer was generated by Manning's knowledge graph from the text of LLMs in Production. The section links point to the parts of the book it draws on.