Skip to content

Commit

Permalink
Reduced dependency load
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-potter committed Jan 28, 2024
1 parent 633f9e3 commit 5030a2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion harper-ls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
[dependencies]
harper-core = { path = "../harper-core", version = "0.5.0" }
tower-lsp = "0.20.0"
tokio = { version = "1.35.1", features = ["full"] }
tokio = { version = "1.35.1", features = ["fs", "rt", "rt-multi-thread", "macros", "io-std", "io-util", "net"] }
clap = { version = "4.4.18", features = ["derive"] }
once_cell = "1.19.0"
tree-sitter = "0.20.10"
Expand Down
4 changes: 2 additions & 2 deletions harper-ls/src/backend.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::HashMap, fs};
use std::collections::HashMap;

use harper_core::{
parsers::{Markdown, Parser},
Expand Down Expand Up @@ -33,7 +33,7 @@ pub struct Backend {

impl Backend {
async fn update_document_from_file(&self, url: &Url) {
let content = fs::read_to_string(url.path()).unwrap();
let content = tokio::fs::read_to_string(url.path()).await.unwrap();
self.update_document(url, &content).await;
}

Expand Down
4 changes: 3 additions & 1 deletion harper-ls/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ async fn main() {
let stdout = tokio::io::stdout();
Server::new(stdin, stdout, socket).serve(service).await;
} else {
let listener = TcpListener::bind("127.0.0.1:4000").await.unwrap();
let address = "127.0.0.1:4000";
let listener = TcpListener::bind(address).await.unwrap();
println!("Listening on {}", address);
let (stream, _) = listener.accept().await.unwrap();
let (read, write) = tokio::io::split(stream);
Server::new(read, write, socket).serve(service).await;
Expand Down

0 comments on commit 5030a2b

Please sign in to comment.