liveBook · Manning

VS Code API

As explained in LLMs in Production

The VS Code API is the programming interface through which extensions interact with Visual Studio Code and its editor features.

The VS Code API lets an extension connect editor interactions to custom behavior. A coding copilot uses it to read highlighted code, call an LLM service, and return ghost-text suggestions. section 10.3

Selected-code coding copilot

A user highlights code and presses Alt+S. The provider reads the selection, posts it to a local generation endpoint, and places the returned text after the selection for preview and acceptance. section 10.3

How LLMs in Production covers it

How deep it goes
Explains lifecycle setup, provider registration, editor state, and API requests, but stops short of covering the complete provider implementation.
Examples
Uses a generated extension, an Alt+S keybinding, selected Python code, a local generation endpoint, and ghost-text completion.
What it assumes
Assumes a generated extension and an available LLM API, while introducing the unfamiliar VS Code API through template code.
What you can do after
Builds an inline completion provider that reads selected code, calls an LLM endpoint, and returns editor suggestions.
How it connects
Connects VS Code extensions, inline completion providers, commands, activation lifecycle, LLM APIs, and retrieval-augmented generation.

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.