#![allow(unused)]
use js_sys::{Function, Promise};
use wasm_bindgen::prelude::*;
use crate::LONG_VERSION;
#[wasm_bindgen]
pub fn version() -> String {
LONG_VERSION.clone()
}
#[wasm_bindgen]
pub struct TinymistLanguageServer {
send_diagnostics: Function,
send_request: Function,
send_notification: Function,
}
#[wasm_bindgen]
impl TinymistLanguageServer {
#[wasm_bindgen(constructor)]
pub fn new(
send_diagnostics: Function,
send_request: Function,
send_notification: Function,
) -> Self {
std::panic::set_hook(Box::new(console_error_panic_hook::hook));
Self {
send_diagnostics,
send_request,
send_notification,
}
}
pub fn on_request(&self, method: String, js_params: JsValue) -> Result<JsValue, JsValue> {
todo!()
}
pub fn on_notification(&self, method: String, js_params: JsValue) -> Promise {
todo!()
}
}