mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-27 16:07:46 +00:00
return error on combination of bidirectional message and json framing
This commit is contained in:
parent
9b03499a3b
commit
41dade9006
@ -22,7 +22,7 @@ use crate::{
|
||||
},
|
||||
},
|
||||
process::ProcMacroServerProcess,
|
||||
transport::codec::{json::JsonProtocol, postcard::PostcardProtocol},
|
||||
transport::codec::postcard::PostcardProtocol,
|
||||
version,
|
||||
};
|
||||
|
||||
@ -210,14 +210,16 @@ fn run_request(
|
||||
msg: BidirectionalMessage,
|
||||
callback: SubCallback<'_>,
|
||||
) -> Result<BidirectionalMessage, ServerError> {
|
||||
if let Some(server_error) = srv.exited() {
|
||||
return Err(server_error.clone());
|
||||
if let Some(err) = srv.exited() {
|
||||
return Err(err.clone());
|
||||
}
|
||||
|
||||
if srv.use_postcard() {
|
||||
srv.run_bidirectional::<PostcardProtocol>(msg, callback)
|
||||
} else {
|
||||
srv.run_bidirectional::<JsonProtocol>(msg, callback)
|
||||
match srv.use_postcard() {
|
||||
true => srv.run_bidirectional::<PostcardProtocol>(msg, callback),
|
||||
false => Err(ServerError {
|
||||
message: "bidirectional messaging does not support JSON".to_owned(),
|
||||
io: None,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user