Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit d2cc327

Browse files
authored
Merge pull request #1513 from Xanewok/collect-files-after-expansion
Collect file -> edition mapping after AST expansion
2 parents 8ee1721 + 04ae465 commit d2cc327

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Support both owned and borrowed blacklisted crate names in `rls-analysis`
77
- Publicly re-export `rls_analysis::raw::Crate`
88
### Changed
9+
- Formatting project files now only needs project to parse and expand macros (and not type-check)
910
- Converted remaining crates `rls-*` to 2018 edition
1011
### Removed
1112
- Removed `use_crate_blacklist` setting in favour of `crate_blacklist`

rls/src/build/rustc.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl rustc_driver::Callbacks for RlsRustcCalls {
166166
Compilation::Continue
167167
}
168168

169-
fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
169+
fn after_expansion(&mut self, compiler: &interface::Compiler) -> Compilation {
170170
let sess = compiler.session();
171171
let input = compiler.input();
172172
let crate_name = compiler.crate_name().unwrap().peek().clone();
@@ -189,11 +189,20 @@ impl rustc_driver::Callbacks for RlsRustcCalls {
189189
},
190190
};
191191

192+
// We populate the file -> edition mapping only after expansion since it
193+
// can pull additional input files
192194
let mut input_files = self.input_files.lock().unwrap();
193195
for file in fetch_input_files(sess) {
194196
input_files.entry(file).or_default().insert(krate.clone());
195197
}
196198

199+
Compilation::Continue
200+
}
201+
202+
fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
203+
let input = compiler.input();
204+
let crate_name = compiler.crate_name().unwrap().peek().clone();
205+
197206
// Guaranteed to not be dropped yet in the pipeline thanks to the
198207
// `config.opts.debugging_opts.save_analysis` value being set to `true`.
199208
let expanded_crate = &compiler.expansion().unwrap().peek().0;

0 commit comments

Comments
 (0)