diff --git a/README.md b/README.md index 2254ebd..328a1e4 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,20 @@ # protols -Language server for proto files +A Language Server for **proto3** files. It only uses tree-sitter parser for all operations and always runs in **single file mode**. + +## Features +- [x] Hover +- [x] Go to definition +- [x] Diagnostics + + +## Installation and testing + +Clone the repository and run `cargo install --path .` to install locally in your `~/.cargo/bin` and the below to your `init.lua` until we start shipping this via Mason. -## Testing with neovim ```lua local client = vim.lsp.start_client({ name = "protols", - cmd = { "" }, + cmd = { vim.fn.expand("$HOME/.cargo/bin/protols") }, }) if not client then diff --git a/src/main.rs b/src/main.rs index 0d88698..7f9b132 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ use async_lsp::server::LifecycleLayer; use async_lsp::tracing::TracingLayer; use server::{ServerState, TickEvent}; use tower::ServiceBuilder; -use tracing::Level; +use tracing::{info, Level}; mod lsp; mod parser; @@ -39,8 +39,13 @@ async fn main() { .service(ServerState::new_router(client)) }); + let mut dir = std::env::temp_dir(); + dir.push("protols.log"); + + eprintln!("Logs are being written to {:?}", dir); + let file_appender = - tracing_appender::rolling::daily("/Users/ashar/Developer/protols/logs", "lsp.log"); + tracing_appender::rolling::daily(std::env::temp_dir().as_path(), "protols.log"); let (non_blocking, _gaurd) = tracing_appender::non_blocking(file_appender); tracing_subscriber::fmt()