01Chapter 1: What inline completions are and how ghost text worksThis chapter assumes you can edit code in an IDE such as VS Code or a JetBrains IDE. It also assumes you know that a large language model predicts text from a prompt, and that you can read short Python or TypeScript snippets. Later chapters build on the model described here, so the goal is a working7 min read
02Chapter 2: Building the request: prefix, suffix and related contextThis chapter assumes you can read Python, know that a language model predicts text from a prompt, and have used an inline completion feature such as ghost text in VS Code. The previous chapter showed how ghost text appears at the cursor. This one covers what the editor sends to the model to produce 6 min read
03Chapter 3: Fill-in-the-middle promptingThis chapter assumes you know what an inline completion request contains (text before the cursor, text after it, and some related context). It also assumes you can read short Python snippets. Here you will see how that request becomes a prompt for a model that can write text in the middle of a file.6 min read
04Chapter 4: When to ask: triggering, debouncing and cancelling requestsThis chapter assumes you have read the earlier chapters on inline completions and context assembly. You should know what ghost text is and how a prefix and suffix are built. You should also read basic TypeScript or Python, and know what a promise and a timer are.7 min read
05Chapter 5: Cleaning model output before showing itA model's raw output is rarely ready to show as ghost text. It can include special tokens, repeat code that is already in the file, run past the end of the logical block, or return only whitespace. This chapter covers the post-processing step between the model response and the editor.6 min read
06Chapter 6: Accepting, rejecting and partially accepting suggestionsThis chapter assumes you know how ghost text appears at the cursor and how a request is built from the prefix and suffix. It also assumes you can read short Python and JSON. It covers what happens after a suggestion is on screen: how the user takes it, ignores it or takes only part of it, and what t7 min read
07Chapter 7: Writing a completion provider in an editor extensionAn editor extension turns a model into ghost text by registering a provider with the editor. The editor calls the provider when a suggestion might be needed. The provider returns text, and the editor draws and accepts it. This chapter builds that provider for VS Code in TypeScript. JetBrains and oth6 min read
08Chapter 8: Using recent edits as contextThis chapter assumes you have read the chapter on building the request from prefix, suffix and related context. It also assumes you can read a unified diff and write basic Python.6 min read
09Chapter 9: Next edit suggestions: predicting the edit, not just the textThis chapter explains what a next edit suggestion (NES) is, what it needs as input, and what it produces. It assumes you have read the earlier chapters on inline completions, context assembly and accepting suggestions. You should be comfortable with diffs, and with reading short Python and TypeScrip7 min read
10Chapter 10: Where the next edit goes and how it is shown as a diffThis chapter assumes you know what a next edit suggestion (NES) is and why recent edits are used as context. It also assumes you can read a unified diff and write basic Python. It covers two questions. How does the system decide which place in the file to change? How does it present that change so y6 min read
11Chapter 11: Choosing between completions and next edit suggestionsThis chapter assumes you have read the earlier chapters on inline completions, fill-in-the-middle prompting, post-processing, and next edit suggestions (NES). It also assumes you can read short Python and a unified diff. The goal is to decide which feature should respond to a given editing situation6 min read
12Chapter 12: Measuring quality: acceptance rate, latency and retentionThis chapter covers the three numbers most teams use to judge a completion or next edit suggestion feature, and the ways each one misleads. It assumes you know how a suggestion is requested, debounced, cancelled, post-processed and shown (earlier chapters), that you can read Python, and that you kno6 min read
13Chapter 13: Privacy, data handling and licensing considerationsThis chapter assumes you know how a completion request is built from the prefix, suffix and related files. It also assumes you have used a completion extension in VS Code or a JetBrains IDE. It covers what leaves your machine, what the provider may do with it, and what comes back that you may not be6 min read
14Chapter 14: Common failure modes and reviewing suggestions safelyThis chapter assumes you know how inline completions and next edit suggestions (NES) are produced. That covers prefix and suffix context, fill-in-the-middle prompting, debouncing, post-processing, and the use of recent edit history. It also assumes you can read Python or TypeScript and a unified dif7 min read