lsp_types/error_codes.rs
1//! In this module we only define constants for lsp specific error codes.
2//! There are other error codes that are defined in the
3//! [JSON RPC specification](https://www.jsonrpc.org/specification#error_object).
4
5// This is the start range of LSP reserved error codes.
6// It doesn't denote a real error code.
7//
8// @since 3.16.0
9pub const LSP_RESERVED_ERROR_RANGE_START: i64 = -32899;
10
11// The server cancelled the request. This error code should
12// only be used for requests that explicitly support being
13// server cancellable.
14//
15// @since 3.17.0
16pub const SERVER_CANCELLED: i64 = -32802;
17
18// The server detected that the content of a document got
19// modified outside normal conditions. A server should
20// NOT send this error code if it detects a content change
21// in it unprocessed messages. The result even computed
22// on an older state might still be useful for the client.
23//
24// If a client decides that a result is not of any use anymore
25// the client should cancel the request.
26pub const CONTENT_MODIFIED: i64 = -32801;
27
28// The client has canceled a request and a server as detected
29// the cancel.
30pub const REQUEST_CANCELLED: i64 = -32800;
31
32// This is the end range of LSP reserved error codes.
33// It doesn't denote a real error code.
34//
35// @since 3.16.0
36pub const LSP_RESERVED_ERROR_RANGE_END: i64 = -32800;