sync_lsp/text_document/
did_close.rs1use crate::{Server, TypeProvider};
9use crate::connection::{Callback, Endpoint};
10use serde::Deserialize;
11use super::TextDocumentIdentifer;
12
13#[derive(Default, Clone)]
14pub(crate) struct DidCloseOptions;
15
16#[derive(Deserialize)]
17#[serde(rename_all = "camelCase")]
18struct DidCloseTextDocumentParams {
19 text_document: TextDocumentIdentifer,
20}
21
22
23impl DidCloseOptions {
24
25 pub(crate) const METHOD: &'static str = "textDocument/didClose";
26
27 pub(crate) fn endpoint<T: TypeProvider>() -> Endpoint<T, DidCloseOptions> {
28 Endpoint::new(Callback::notification(|_, _: DidCloseTextDocumentParams| {
29
30 }))
31 }
32}
33
34impl<T: TypeProvider> Server<T> {
35
36 pub fn on_close(&mut self, callback: fn(&mut Server<T>, TextDocumentIdentifer)) {
44 self.text_document.did_close.set_callback(Callback::notification(move |server, params: DidCloseTextDocumentParams| {
45 callback(server, params.text_document)
46 }))
47 }
48}