|
2 | 2 | //! There are other error codes that are defined in the
|
3 | 3 | //! [JSON RPC specification](https://www.jsonrpc.org/specification#error_object).
|
4 | 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 |
| 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 |
9 | 19 | pub const LSP_RESERVED_ERROR_RANGE_START: i64 = -32899;
|
10 | 20 |
|
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 |
| 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 |
16 | 34 | pub const SERVER_CANCELLED: i64 = -32802;
|
17 | 35 |
|
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. |
| 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. |
26 | 44 | pub const CONTENT_MODIFIED: i64 = -32801;
|
27 | 45 |
|
28 |
| -// The client has canceled a request and a server as detected |
29 |
| -// the cancel. |
| 46 | +/// The client has canceled a request and a server as detected |
| 47 | +/// the cancel. |
30 | 48 | pub const REQUEST_CANCELLED: i64 = -32800;
|
31 | 49 |
|
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 |
| 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 |
36 | 54 | pub const LSP_RESERVED_ERROR_RANGE_END: i64 = -32800;
|
0 commit comments