liveBook · Manning

Inline completion item

As explained in LLMs in Production

An inline completion item is a proposed text completion that a VS Code inline suggestion provider returns for display in the editor.

An inline completion item is a proposed text completion displayed as ghost text at the cursor. Users can preview it, accept it with Tab, reject it, or cycle through alternatives. section 10.3

A VS Code inline suggestion provider returns these items in an array. A provider receives the document, cursor position, invocation context, and cancellation token, then supplies one or more candidates. section 10.3

Selection-driven completion

A coding copilot can activate on a keybinding, collect the selected code, post it to a local generation endpoint, and place the returned text after the selection. Rechecking reversed selections keeps the cursor at the correct end for display.

How LLMs in Production covers it

How deep it goes
Explains returned candidates, provider inputs, trigger handling, selection correction, and LLM response flow.
Examples
Demonstrates ghost-text suggestions, Python-only registration, manual triggering, highlighted code, and a local generation endpoint.
What it assumes
Assumes basic VS Code extension structure and an available LLM generation endpoint.
What you can do after
Build it from scratch with the VS Code API and connect generated responses to inline editor suggestions.
How it connects
Connects inline suggestion providers with the VS Code API, editor selections, keybindings, and LLM services.

Related concepts

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.