My personal-knowledge-system, with deeply integrated task tracking and long term goal planning capabilities.
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: init lsp

+150 -5
+106 -1
Cargo.lock
··· 759 759 ] 760 760 761 761 [[package]] 762 + name = "auto_impl" 763 + version = "1.3.0" 764 + source = "registry+https://github.com/rust-lang/crates.io-index" 765 + checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" 766 + dependencies = [ 767 + "proc-macro2", 768 + "quote", 769 + "syn 2.0.117", 770 + ] 771 + 772 + [[package]] 762 773 name = "autocfg" 763 774 version = "1.5.0" 764 775 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1684 1695 1685 1696 [[package]] 1686 1697 name = "dashmap" 1698 + version = "5.5.3" 1699 + source = "registry+https://github.com/rust-lang/crates.io-index" 1700 + checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" 1701 + dependencies = [ 1702 + "cfg-if", 1703 + "hashbrown 0.14.5", 1704 + "lock_api", 1705 + "once_cell", 1706 + "parking_lot_core", 1707 + ] 1708 + 1709 + [[package]] 1710 + name = "dashmap" 1687 1711 version = "6.1.0" 1688 1712 source = "registry+https://github.com/rust-lang/crates.io-index" 1689 1713 checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" ··· 2315 2339 "tempfile", 2316 2340 "tokio", 2317 2341 "tokio-util", 2342 + "tower-lsp", 2318 2343 "tracing", 2319 2344 "tracing-error", 2320 2345 "tracing-subscriber", ··· 3282 3307 source = "registry+https://github.com/rust-lang/crates.io-index" 3283 3308 checksum = "ad89218e74850f42d364ed3877c7291f0474c8533502df91bb877ecc5cb0dd40" 3284 3309 dependencies = [ 3285 - "dashmap", 3310 + "dashmap 6.1.0", 3286 3311 "gix-fs", 3287 3312 "libc", 3288 3313 "parking_lot", ··· 3669 3694 ] 3670 3695 3671 3696 [[package]] 3697 + name = "httparse" 3698 + version = "1.10.1" 3699 + source = "registry+https://github.com/rust-lang/crates.io-index" 3700 + checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" 3701 + 3702 + [[package]] 3672 3703 name = "human-panic" 3673 3704 version = "2.0.6" 3674 3705 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4295 4326 checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593" 4296 4327 dependencies = [ 4297 4328 "hashbrown 0.16.1", 4329 + ] 4330 + 4331 + [[package]] 4332 + name = "lsp-types" 4333 + version = "0.94.1" 4334 + source = "registry+https://github.com/rust-lang/crates.io-index" 4335 + checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1" 4336 + dependencies = [ 4337 + "bitflags 1.3.2", 4338 + "serde", 4339 + "serde_json", 4340 + "serde_repr", 4341 + "url", 4298 4342 ] 4299 4343 4300 4344 [[package]] ··· 7398 7442 checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" 7399 7443 7400 7444 [[package]] 7445 + name = "tower" 7446 + version = "0.4.13" 7447 + source = "registry+https://github.com/rust-lang/crates.io-index" 7448 + checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 7449 + dependencies = [ 7450 + "futures-core", 7451 + "futures-util", 7452 + "pin-project", 7453 + "pin-project-lite", 7454 + "tower-layer", 7455 + "tower-service", 7456 + ] 7457 + 7458 + [[package]] 7459 + name = "tower-layer" 7460 + version = "0.3.3" 7461 + source = "registry+https://github.com/rust-lang/crates.io-index" 7462 + checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" 7463 + 7464 + [[package]] 7465 + name = "tower-lsp" 7466 + version = "0.20.0" 7467 + source = "registry+https://github.com/rust-lang/crates.io-index" 7468 + checksum = "d4ba052b54a6627628d9b3c34c176e7eda8359b7da9acd497b9f20998d118508" 7469 + dependencies = [ 7470 + "async-trait", 7471 + "auto_impl", 7472 + "bytes", 7473 + "dashmap 5.5.3", 7474 + "futures", 7475 + "httparse", 7476 + "lsp-types", 7477 + "memchr", 7478 + "serde", 7479 + "serde_json", 7480 + "tokio", 7481 + "tokio-util", 7482 + "tower", 7483 + "tower-lsp-macros", 7484 + "tracing", 7485 + ] 7486 + 7487 + [[package]] 7488 + name = "tower-lsp-macros" 7489 + version = "0.9.0" 7490 + source = "registry+https://github.com/rust-lang/crates.io-index" 7491 + checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa" 7492 + dependencies = [ 7493 + "proc-macro2", 7494 + "quote", 7495 + "syn 2.0.117", 7496 + ] 7497 + 7498 + [[package]] 7499 + name = "tower-service" 7500 + version = "0.3.3" 7501 + source = "registry+https://github.com/rust-lang/crates.io-index" 7502 + checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 7503 + 7504 + [[package]] 7401 7505 name = "tracing" 7402 7506 version = "0.1.44" 7403 7507 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 7600 7704 "idna", 7601 7705 "percent-encoding", 7602 7706 "serde", 7707 + "serde_derive", 7603 7708 ] 7604 7709 7605 7710 [[package]]
+1
Cargo.toml
··· 81 81 ratatui-textarea = "0.8.0" 82 82 nucleo-matcher = "0.3.1" 83 83 ron = "0.12.1" 84 + tower-lsp = "0.20.0" 84 85 85 86 [build-dependencies] 86 87 anyhow = "1.0.102"
+3
src/cli/mod.rs
··· 29 29 #[command(subcommand)] 30 30 Zettel(ZettelSubcommand), 31 31 32 + /// Spawn the `LSP` 33 + Lsp, 34 + 32 35 // / Manage TARS groups. 33 36 // #[command(subcommand)] 34 37 // Group(GroupSubcommand),
+9
src/cli/process.rs
··· 5 5 }; 6 6 7 7 use color_eyre::eyre::{Context, Result}; 8 + use tower_lsp::{LspService, Server}; 8 9 9 10 use crate::{ 10 11 cli::{Commands, ZettelSubcommand}, 11 12 config::{Config, get_config_dir}, 13 + lsp::Backend, 12 14 types::{Kasten, Zettel}, 13 15 }; 14 16 ··· 53 55 } 54 56 ZettelSubcommand::List { by_tag: _by_tag } => {} 55 57 } 58 + } 59 + Self::Lsp => { 60 + let stdin = tokio::io::stdin(); 61 + let stdout = tokio::io::stdout(); 62 + 63 + let (service, socket) = LspService::new(|client| Backend { client }); 64 + Server::new(stdin, stdout, socket).serve(service).await; 56 65 } 57 66 } 58 67
+27
src/lsp/mod.rs
··· 1 + use tower_lsp::{ 2 + Client, LanguageServer, 3 + jsonrpc::Result, 4 + lsp_types::{InitializeParams, InitializeResult, InitializedParams, MessageType}, 5 + }; 6 + 7 + #[derive(Debug)] 8 + pub struct Backend { 9 + pub client: Client, 10 + } 11 + 12 + #[tower_lsp::async_trait] 13 + impl LanguageServer for Backend { 14 + async fn initialize(&self, _: InitializeParams) -> Result<InitializeResult> { 15 + Ok(InitializeResult::default()) 16 + } 17 + 18 + async fn initialized(&self, _: InitializedParams) { 19 + self.client 20 + .log_message(MessageType::INFO, "server initialized!") 21 + .await; 22 + } 23 + 24 + async fn shutdown(&self) -> Result<()> { 25 + Ok(()) 26 + } 27 + }
+4 -4
src/main.rs
··· 16 16 use tracing::debug; 17 17 18 18 mod cli; 19 - mod gui; 20 - mod tui; 21 - mod types; 22 - 23 19 mod config; 24 20 mod errors; 21 + mod gui; 25 22 mod logging; 23 + mod lsp; 24 + mod tui; 25 + mod types; 26 26 27 27 fn main() -> color_eyre::Result<()> { 28 28 errors::init()?;