microsoft / language-server-protocol

Defines a common protocol for language servers.
https://microsoft.github.io/language-server-protocol/
Creative Commons Attribution 4.0 International
10.91k stars 764 forks source link

Range property in TextDocumentContentChangeEvent inconsistent with comment #1870

Closed leitzler closed 6 months ago

leitzler commented 6 months ago

In TextDocumentContentChangeEvent, the Range property isn't optional: https://github.com/microsoft/language-server-protocol/blob/80b9d4afb6c60a5e19d8c2faee3e5b28cfb50735/_specifications/lsp/3.18/textDocument/didChange.md?plain=1#L74

But the comment above do state that the event can be sent with only text:

/**
 * An event describing a change to a text document. If only a text is provided
 * it is considered to be the full content of the document.
 */
dbaeumer commented 6 months ago

This is covered by the OR type

| {
    /**
     * The new text of the whole document.
     */
    text: string;
}