Protocols
Saved & recent

JSON-RPC notifications

Also called: one-way JSON-RPC message, notification request

A JSON-RPC 2.0 notification is a request without an id member. The receiver must not send a JSON-RPC response, even when the notification encounters an error. Notifications suit information that does not need a matching protocol reply, such as an editor announcing a document change.

An illustrative cursorMoved notification could carry a line number without an ID. The sender cannot use silence to conclude that the application processed it successfully. A transport may still acknowledge delivery of bytes, but that is different from an application result. If the sender needs a result or a reportable error, it should use a request with an ID instead.

Read first
JSON-RPC
Related
JSON-RPC, LSP document synchronization, Delivery semantics
Further reading
JSON-RPC Working Group — JSON-RPC 2.0 specification
notification · no id member method: "cursorMoved" params: { line: 4 } no reply ordinary request method: "position" id: 9 matching response result: 4 id: 9 request · id 9 result · id 9 transport delivery and application processing
A notification omits its ID and receives no JSON-RPC reply; a request uses an ID to match a result or error.

View in the full Protocols collection