Expand description
JSON-RPC protocol types, error handling, and capabilities for perl-lsp.
This crate isolates protocol types from the LSP runtime so they can be shared across binaries and provider layers. Key modules:
jsonrpc— Core JSON-RPC 2.0 request, response, and error message typeserrors— Standard and LSP-specific JSON-RPC error codes and buildersmethods— LSP 3.17 method name constants for request/notification routingcapabilities— Server capability configuration advertised duringinitialize
Modules§
- capabilities
- LSP Server Capabilities Configuration for Perl Tooling
- methods
- LSP method name constants for standardized request/notification routing.
Structs§
- Json
RpcError - JSON-RPC 2.0 error object
- Json
RpcRequest - JSON-RPC 2.0 request message
- Json
RpcResponse - JSON-RPC 2.0 response message
Constants§
- CONNECTION_
CLOSED - Connection closed - The connection was closed unexpectedly
- CONTENT_
MODIFIED - Content modified - The document content was modified during operation
- INTERNAL_
ERROR - Internal error - Internal JSON-RPC error
- INVALID_
PARAMS - Invalid params - Invalid method parameter(s)
- INVALID_
REQUEST - Invalid Request - The JSON sent is not a valid Request object
- METHOD_
NOT_ FOUND - Method not found - The method does not exist / is not available
- PARSE_
ERROR - Parse error - Invalid JSON was received
- REQUEST_
CANCELLED - Request cancelled - Client cancelled via $/cancelRequest
- REQUEST_
FAILED - Request failed - Generic request failure (LSP 3.17)
- SERVER_
CANCELLED - Server cancelled the request (LSP 3.17)
- SERVER_
ERROR_ END - Server error range end (inclusive) Per JSON-RPC 2.0 spec, server errors are between -32099 and -32000 inclusive.
- SERVER_
ERROR_ START - Server error range start (reserved for implementation-defined server-errors) Per JSON-RPC 2.0 spec, server errors are between -32099 and -32000 inclusive.
- SERVER_
NOT_ INITIALIZED - Server not initialized
- TRANSPORT_
ERROR - Transport error - A general transport-layer error occurred
- UNKNOWN_
ERROR_ CODE - Unknown error code (for internal use)
Functions§
- cancelled_
response - Create a standard cancelled response
- cancelled_
response_ with_ method - Create a cancelled response with method/provider context
- connection_
closed_ error - Create a connection closed error
- document_
not_ found_ error - Create a document not found error response value
- enhanced_
error - Create an enhanced error response with comprehensive context
- internal_
error - Create an internal error
- invalid_
params - Create an invalid params error
- method_
not_ advertised - Create a method not advertised error
- method_
not_ found - Create a method not found error
- req_
position - Extract the required position (line, character) from LSP request params
- req_
range - Extract the required range from LSP request params
- req_uri
- Extract the required textDocument.uri from LSP request params
- request_
cancelled_ error - Create a request cancelled error
- server_
cancelled_ error - Create a server cancelled error
- server_
not_ initialized - Create a server not initialized error
- transport_
error - Create a transport error with custom message