| 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 | /// Defined in the LSP specification but in the range reserved for JSON-RPC error codes, |
| 6 | /// namely the -32099 to -32000 "Reserved for implementation-defined server-errors." range. |
| 7 | /// The code has, nonetheless, been left in this range for backwards compatibility reasons. |
| 8 | pub const SERVER_NOT_INITIALIZED: i64 = -32002; |
| 9 | |
| 10 | /// Defined in the LSP specification but in the range reserved for JSON-RPC error codes, |
| 11 | /// namely the -32099 to -32000 "Reserved for implementation-defined server-errors." range. |
| 12 | /// The code has, nonetheless, left in this range for backwards compatibility reasons. |
| 13 | pub const UNKNOWN_ERROR_CODE: i64 = -32001; |
| 14 | |
| 15 | /// This is the start range of LSP reserved error codes. |
| 16 | /// It doesn't denote a real error code. |
| 17 | /// |
| 18 | /// @since 3.16.0 |
| 19 | pub const LSP_RESERVED_ERROR_RANGE_START: i64 = -32899; |
| 20 | |
| 21 | /// A request failed but it was syntactically correct, e.g the |
| 22 | /// method name was known and the parameters were valid. The error |
| 23 | /// message should contain human readable information about why |
| 24 | /// the request failed. |
| 25 | /// |
| 26 | /// @since 3.17.0 |
| 27 | pub const REQUEST_FAILED: i64 = -32803; |
| 28 | |
| 29 | /// The server cancelled the request. This error code should |
| 30 | /// only be used for requests that explicitly support being |
| 31 | /// server cancellable. |
| 32 | /// |
| 33 | /// @since 3.17.0 |
| 34 | pub const SERVER_CANCELLED: i64 = -32802; |
| 35 | |
| 36 | /// The server detected that the content of a document got |
| 37 | /// modified outside normal conditions. A server should |
| 38 | /// NOT send this error code if it detects a content change |
| 39 | /// in it unprocessed messages. The result even computed |
| 40 | /// on an older state might still be useful for the client. |
| 41 | /// |
| 42 | /// If a client decides that a result is not of any use anymore |
| 43 | /// the client should cancel the request. |
| 44 | pub const CONTENT_MODIFIED: i64 = -32801; |
| 45 | |
| 46 | /// The client has canceled a request and a server as detected |
| 47 | /// the cancel. |
| 48 | pub const REQUEST_CANCELLED: i64 = -32800; |
| 49 | |
| 50 | /// This is the end range of LSP reserved error codes. |
| 51 | /// It doesn't denote a real error code. |
| 52 | /// |
| 53 | /// @since 3.16.0 |
| 54 | pub const LSP_RESERVED_ERROR_RANGE_END: i64 = -32800; |
| 55 | |