LSP completion
Also called: textDocument/completion, completionItem/resolve
Completion asks a language server for useful suggestions at a document position. The server can return items with labels, insertion text or edits, and hints for sorting or filtering. The editor presents those options; a suggestion does not change the document merely because the server returned it.
For example, typing pri can produce a print suggestion. If supported, selecting that item can trigger completionItem/resolve to fetch documentation. By default, only detail and documentation can be filled in later; clients can explicitly permit other properties. Any property outside that declared set must already be supplied and remain unchanged. The editor applies the suggestion when the user accepts it.
- Read first
- LSP document synchronization
- Further reading
- Microsoft — LSP 3.18 completion