Skip to main content

Crate perl_lsp_protocol

Crate perl_lsp_protocol 

Source
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 types
  • errors — Standard and LSP-specific JSON-RPC error codes and builders
  • methods — LSP 3.17 method name constants for request/notification routing
  • capabilities — Server capability configuration advertised during initialize

Modules§

capabilities
LSP Server Capabilities Configuration for Perl Tooling
methods
LSP method name constants for standardized request/notification routing.

Structs§

JsonRpcError
JSON-RPC 2.0 error object
JsonRpcRequest
JSON-RPC 2.0 request message
JsonRpcResponse
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