Skip to content

Commit

Permalink
fix(lsp): solve the hanging shutdown problem
Browse files Browse the repository at this point in the history
The connection instance was kept alive, which caused the background
threads to idle as they were waiting for all channels to be dropped.
  • Loading branch information
dnaka91 committed Dec 13, 2023
1 parent 6bb08d5 commit a9836cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/stef-lsp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ fn main() -> Result<()> {
let cli = Cli::parse();
logging::init(None)?;

let (connection, _io_threads) = if cli.stdio {
let (connection, io_threads) = if cli.stdio {
Connection::stdio()
} else if let Some(file) = cli.pipe {
unimplemented!("open connection on pipe/socket {file:?}");
Expand Down Expand Up @@ -403,8 +403,8 @@ fn main() -> Result<()> {
return Err(e);
}

// TODO: investigate why this hangs
// io_threads.join()?;
drop(connection);
io_threads.join()?;

info!("goodbye!");

Expand Down

0 comments on commit a9836cb

Please sign in to comment.