mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Merge #5692
5692: Add support for extern crate r=jonas-schievink a=Nashenas88 This adds syntax highlighting, hover and goto def functionality for extern crate. Fixes #5690 Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
This commit is contained in:
commit
7a03f05eac
15 changed files with 224 additions and 59 deletions
|
@ -72,7 +72,7 @@ impl AnalysisStatsCmd {
|
|||
shuffle(&mut rng, &mut krates);
|
||||
}
|
||||
for krate in krates {
|
||||
let module = krate.root_module(db).expect("crate without root module");
|
||||
let module = krate.root_module(db);
|
||||
let file_id = module.definition_source(db).file_id;
|
||||
let file_id = file_id.original_file(db);
|
||||
let source_root = db.file_source_root(file_id);
|
||||
|
|
|
@ -28,7 +28,7 @@ pub fn diagnostics(
|
|||
let mut work = Vec::new();
|
||||
let krates = Crate::all(db);
|
||||
for krate in krates {
|
||||
let module = krate.root_module(db).expect("crate without root module");
|
||||
let module = krate.root_module(db);
|
||||
let file_id = module.definition_source(db).file_id;
|
||||
let file_id = file_id.original_file(db);
|
||||
let source_root = db.file_source_root(file_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue