Skip to content

Commit

Permalink
Collect files -> editions mapping after expansion when out-of-process
Browse files Browse the repository at this point in the history
Applies the equivalent of rust-lang#1513 in the out-of-process compilation case
  • Loading branch information
Xanewok committed Aug 13, 2019
1 parent 53a5043 commit 69f7723
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions rls-rustc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,12 @@ impl Callbacks for ShimCalls {
Compilation::Continue
}

fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
fn after_expansion(&mut self, compiler: &interface::Compiler) -> Compilation {
let callbacks = match self.callbacks.as_ref() {
Some(callbacks) => callbacks,
None => return Compilation::Continue,
};

use rustc_save_analysis::CallbackHandler;

let sess = compiler.session();
let input = compiler.input();
let crate_name = compiler.crate_name().unwrap().peek().clone();
Expand Down Expand Up @@ -138,6 +136,20 @@ impl Callbacks for ShimCalls {
eprintln!("Can't send input files as part of a compilation callback: {:?}", e);
}

Compilation::Continue
}

fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
let callbacks = match self.callbacks.as_ref() {
Some(callbacks) => callbacks,
None => return Compilation::Continue,
};

use rustc_save_analysis::CallbackHandler;

let input = compiler.input();
let crate_name = compiler.crate_name().unwrap().peek().clone();

// Guaranteed to not be dropped yet in the pipeline thanks to the
// `config.opts.debugging_opts.save_analysis` value being set to `true`.
let expanded_crate = &compiler.expansion().unwrap().peek().0;
Expand Down

0 comments on commit 69f7723

Please sign in to comment.