pub type LspBuilder<Args> = LsBuilder<LspMessage, Args>;
Expand description
The language server builder serving LSP.
Aliased Type§
struct LspBuilder<Args> {
pub args: Args,
pub client: LspClient,
pub events: HashMap<TypeId, Box<dyn for<'a> Fn(ServiceState<'a, Args, <Args as Initializer>::S>, &LspClient, Box<dyn Any + Send>) -> Result<(), Error>>>,
pub command_handlers: HashMap<&'static str, Box<dyn Fn(&mut <Args as Initializer>::S, &LspClient, RequestId, Vec<Value>) -> Result<Option<()>, ResponseError>>>,
pub notif_handlers: HashMap<&'static str, Box<dyn Fn(&mut <Args as Initializer>::S, Value) -> Result<(), ResponseError>>>,
pub req_handlers: HashMap<&'static str, Box<dyn Fn(&mut <Args as Initializer>::S, &LspClient, RequestId, Value) -> Result<Option<()>, ResponseError>>>,
pub resource_handlers: HashMap<Arc<Path>, Box<dyn Fn(&mut <Args as Initializer>::S, &LspClient, RequestId, Vec<Value>) -> Result<Option<()>, ResponseError>>>,
/* private fields */
}
Fields§
§args: Args
The extra initialization arguments.
client: LspClient
The client surface for the implementing language server.
events: HashMap<TypeId, Box<dyn for<'a> Fn(ServiceState<'a, Args, <Args as Initializer>::S>, &LspClient, Box<dyn Any + Send>) -> Result<(), Error>>>
The event handlers.
command_handlers: HashMap<&'static str, Box<dyn Fn(&mut <Args as Initializer>::S, &LspClient, RequestId, Vec<Value>) -> Result<Option<()>, ResponseError>>>
The command handlers.
notif_handlers: HashMap<&'static str, Box<dyn Fn(&mut <Args as Initializer>::S, Value) -> Result<(), ResponseError>>>
The notification handlers.
req_handlers: HashMap<&'static str, Box<dyn Fn(&mut <Args as Initializer>::S, &LspClient, RequestId, Value) -> Result<Option<()>, ResponseError>>>
The LSP request handlers.
resource_handlers: HashMap<Arc<Path>, Box<dyn Fn(&mut <Args as Initializer>::S, &LspClient, RequestId, Vec<Value>) -> Result<Option<()>, ResponseError>>>
The resource handlers.