use rustc_serialize::json::as_json;
-use rls_data::{self, Analysis, CratePreludeData, Def, DefKind, Import, MacroRef, Ref, RefKind,
- Relation, Impl};
use rls_data::config::Config;
+use rls_data::{self, Analysis, CompilationOptions, CratePreludeData, Def, DefKind, Impl, Import,
+ MacroRef, Ref, RefKind, Relation};
use rls_span::{Column, Row};
#[derive(Debug)]
impl<'b, W: Write> DumpOutput for WriteOutput<'b, W> {
fn dump(&mut self, result: &Analysis) {
- if let Err(_) = write!(self.output, "{}", as_json(&result)) {
+ if write!(self.output, "{}", as_json(&result)).is_err() {
error!("Error writing output");
}
}
self.result.prelude = Some(data)
}
+ pub fn compilation_opts(&mut self, data: CompilationOptions) {
+ self.result.compilation = Some(data);
+ }
+
pub fn macro_use(&mut self, data: MacroRef) {
if self.config.pub_only || self.config.reachable_only {
return;