removed comments

This commit is contained in:
frelodev 2024-02-12 19:18:23 +01:00
parent ec8148cc0e
commit 1cbfc49df1

View file

@ -17,13 +17,6 @@ impl From::<Arc<codemp::cursor::Controller>> for JsCursorController {
#[napi] #[napi]
impl JsCursorController { impl JsCursorController {
/*#[napi]
pub fn call_threadsafe_recv(callback: JsFunction) -> Result<()>{
let tsfn: ThreadsafeFunction<u32, ErrorStrategy::CalleeHandled> =
callback.create_threadsafe_function(0, |ctx| Ok(vec![ctx.value + 1]))?;
}*/
#[napi(ts_args_type = "fun: (event: JsCursorEvent) => void")] #[napi(ts_args_type = "fun: (event: JsCursorEvent) => void")]
pub fn callback(&self, fun: napi::JsFunction) -> napi::Result<()>{ pub fn callback(&self, fun: napi::JsFunction) -> napi::Result<()>{
let tsfn : ThreadsafeFunction<codemp::proto::cursor::CursorEvent, ErrorStrategy::Fatal> = let tsfn : ThreadsafeFunction<codemp::proto::cursor::CursorEvent, ErrorStrategy::Fatal> =
@ -47,27 +40,6 @@ impl JsCursorController {
Ok(()) Ok(())
} }
// let controller = codemp.join('default').await
// // TODO register cursor callback, when cursormoved call { controller.send(event) }
// controller.callback( (ev) => {
// editor.change(event.tex)
// });
// #[napi]
// pub async fn recv(&self) -> napi::Result<JsCursorEvent> {
// Ok(
// self.0.recv().await
// .map_err(|e| napi::Error::from(JsCodempError(e)))?
// .into()
// )
// }
#[napi] #[napi]
pub fn send(&self, buffer: String, start: (i32, i32), end: (i32, i32)) -> napi::Result<()> { pub fn send(&self, buffer: String, start: (i32, i32), end: (i32, i32)) -> napi::Result<()> {
let pos = codemp::proto::cursor::CursorPosition { let pos = codemp::proto::cursor::CursorPosition {