mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Abstract proc-macro-srv protocol format
This commit is contained in:
parent
7c7c0cbffb
commit
c236190b60
6 changed files with 60 additions and 39 deletions
|
@ -10,6 +10,7 @@ use paths::AbsPath;
|
|||
use stdx::JodChild;
|
||||
|
||||
use crate::{
|
||||
json::{read_json, write_json},
|
||||
msg::{Message, Request, Response, SpanMode, CURRENT_API_VERSION, RUST_ANALYZER_SPAN_SUPPORT},
|
||||
ProcMacroKind, ServerError,
|
||||
};
|
||||
|
@ -201,11 +202,11 @@ fn send_request(
|
|||
req: Request,
|
||||
buf: &mut String,
|
||||
) -> Result<Response, ServerError> {
|
||||
req.write(&mut writer).map_err(|err| ServerError {
|
||||
req.write(write_json, &mut writer).map_err(|err| ServerError {
|
||||
message: "failed to write request".into(),
|
||||
io: Some(Arc::new(err)),
|
||||
})?;
|
||||
let res = Response::read(&mut reader, buf).map_err(|err| ServerError {
|
||||
let res = Response::read(read_json, &mut reader, buf).map_err(|err| ServerError {
|
||||
message: "failed to read response".into(),
|
||||
io: Some(Arc::new(err)),
|
||||
})?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue