sync-lsp 0.1.0

A synchronous LSP library for servers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{TypeProvider, Server};
use crate::connection::{Callback, CancelParams};

pub(crate) struct Cancel<T: TypeProvider>
    (pub(crate) fn(&mut Server<T>));

impl<T: TypeProvider> Cancel<T> {

    pub(crate) const METHOD: &'static str = "$/cancelRequest";
    
    pub(crate) fn callback(&self) -> Callback<Server<T>> {
        let Cancel(callback) = *self;
        Callback::notification(move |server, _: CancelParams| callback(server))
    }
}