Crates.io | sync-ls |
lib.rs | sync-ls |
version | 0.13.24 |
created_at | 2025-03-19 09:39:19.375445+00 |
updated_at | 2025-08-26 08:17:27.700528+00 |
description | Synchronized language service inspired by async-lsp, primarily for tinymist. |
homepage | https://github.com/Myriad-Dreamin/tinymist |
repository | https://github.com/Myriad-Dreamin/tinymist |
max_upload_size | |
id | 1597834 |
size | 136,770 |
Sync LSP server inspired by async-lsp, primarily for tinymist. The author of this crate thinks that async-lsp is better than sync-ls, so please use async-lsp whenever possible unless you have a good reason to use sync-ls. Some random points:
req_queue
and transport
are extracted from the rust-analyzer project.tower-lsp
.You can record the input during running the editors with binary. You can then replay the input to debug the language server.
# Record the input
your-ls --mirror input.txt
# Replay the input
your-ls --replay input.txt
This is much more useful when devloping a dap server.
Starts a LSP server with stdio transport:
with_stdio_transport::<LspMessage>(args.mirror.clone(), |conn| {
let client = LspClientRoot::new(tokio_handle, conn.sender);
LspBuilder::new(args, client.weak())
// Adds request handlers
.with_request::<Shutdown>(State::shutdown)
// Adds event handlers
.with_event(&LspInterrupt::Settle, State::interrupt)
.build()
.start(conn.receiver, is_replay)
})?;