Skip to content

Commit

Permalink
lsp server: enable option to prevent crash
Browse files Browse the repository at this point in the history
if the option is not enabled, caesar will do some stdout printing
    during verify_files_main. this mangles the language server protocol
    that is also running via stdout.
  • Loading branch information
Philipp15b committed Jan 22, 2025
1 parent 81a0ae4 commit e61cbbf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,11 @@ fn mk_cli_server(input_options: &InputOptions) -> Result<(Vec<FileId>, SharedSer
Ok((user_files, server))
}

async fn run_server(options: VerifyCommand) -> ExitCode {
async fn run_server(mut options: VerifyCommand) -> ExitCode {
let (mut server, _io_threads) = LspServer::connect_stdio(&options);
server.initialize().unwrap();
let server = Arc::new(Mutex::new(server));
options.lsp_options.language_server = true;
let options = Arc::new(options);

let res = run_lsp_server(server.clone(), |user_files| {
Expand Down

0 comments on commit e61cbbf

Please sign in to comment.