Rename 'io' module to 'jrpc_io'

This commit is contained in:
Tad Hardesty 2019-11-30 18:16:33 -08:00
parent 2895d55927
commit 59fa776d32
3 changed files with 9 additions and 9 deletions

View file

@ -30,7 +30,7 @@ mod extools;
use std::error::Error;
use std::sync::{atomic, Arc};
use io;
use jrpc_io;
use self::dap_types::*;
use self::launched::Launched;
use self::extools::Extools;
@ -50,7 +50,7 @@ pub fn start_server(dreamseeker_exe: String) -> std::io::Result<u16> {
let mut input = std::io::BufReader::new(stream.try_clone().unwrap());
let mut debugger = Debugger::new(dreamseeker_exe);
io::run_with_read(&mut input, |message| debugger.handle_input(message));
jrpc_io::run_with_read(&mut input, |message| debugger.handle_input(message));
})?;
Ok(port)
@ -72,7 +72,7 @@ pub fn debugger_main<I: Iterator<Item=String>>(mut args: I) {
eprintln!("dreamseeker: {}", dreamseeker_exe);
let mut debugger = Debugger::new(dreamseeker_exe);
io::run_forever(|message| debugger.handle_input(message));
jrpc_io::run_forever(|message| debugger.handle_input(message));
}
struct Debugger {
@ -129,7 +129,7 @@ impl Debugger {
},
command,
};
io::write(serde_json::to_string(&response).expect("response encode error"))
jrpc_io::write(serde_json::to_string(&response).expect("response encode error"))
}
other => return Err(format!("unknown `type` field {:?}", other).into())
}
@ -322,7 +322,7 @@ impl SequenceNumber {
event: E::EVENT.to_owned(),
body: Some(body),
};
io::write(serde_json::to_string(&message).expect("event encode error"))
jrpc_io::write(serde_json::to_string(&message).expect("event encode error"))
}
fn println<S: Into<String>>(&self, output: S) {

View file

@ -20,7 +20,7 @@ extern crate dreamchecker;
extern crate libc;
#[macro_use] mod macros;
mod io;
mod jrpc_io;
mod document;
mod symbol_search;
mod find_references;
@ -78,7 +78,7 @@ fn main() {
let context = dm::Context::default();
let mut engine = Engine::new(&context);
io::run_forever(|message| engine.handle_input(message));
jrpc_io::run_forever(|message| engine.handle_input(message));
}
const VERSION: Option<jsonrpc::Version> = Some(jsonrpc::Version::V2);
@ -689,7 +689,7 @@ impl<'a> Engine<'a> {
_ => Response::Batch(outputs),
};
io::write(serde_json::to_string(&response).expect("response bad to_string"));
jrpc_io::write(serde_json::to_string(&response).expect("response bad to_string"));
}
fn handle_call(&mut self, call: Call) -> Option<Output> {
@ -1738,7 +1738,7 @@ where
method: T::METHOD.to_owned(),
params: value_to_params(params),
}));
io::write(serde_json::to_string(&request).expect("notification bad to_string"))
jrpc_io::write(serde_json::to_string(&request).expect("notification bad to_string"))
}
fn component_to_source(component: dm::Component) -> Option<String> {