Skip to content

Commit

Permalink
update readme and logs to tempdir
Browse files Browse the repository at this point in the history
  • Loading branch information
coder3101 committed Jun 16, 2024
1 parent 0b84d15 commit 8776cf9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 = { "<absolute path to protols binary>" },
cmd = { vim.fn.expand("$HOME/.cargo/bin/protols") },
})

if not client then
Expand Down
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 8776cf9

Please sign in to comment.