mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Rust: add file for root modules of crates
This commit is contained in:
@@ -6,6 +6,7 @@ use chalk_ir::IntTy;
|
||||
use chalk_ir::Scalar;
|
||||
use chalk_ir::UintTy;
|
||||
use chalk_ir::{FloatTy, Safety};
|
||||
use codeql_extractor::trap::Location;
|
||||
use itertools::Itertools;
|
||||
use ra_ap_base_db::CrateGraph;
|
||||
use ra_ap_base_db::CrateId;
|
||||
@@ -85,6 +86,22 @@ pub fn extract_crate_graph(trap_provider: &trap::TrapFileProvider, db: &RootData
|
||||
DefMap::ROOT,
|
||||
&mut trap,
|
||||
);
|
||||
let file_label = trap.emit_file(root_module_file).as_untyped();
|
||||
let location_label = codeql_extractor::extractor::location_label(
|
||||
&mut trap.writer,
|
||||
Location {
|
||||
file_label,
|
||||
start_line: 0,
|
||||
start_column: 0,
|
||||
end_line: 0,
|
||||
end_column: 0,
|
||||
},
|
||||
);
|
||||
trap.writer.add_tuple(
|
||||
"locatable_locations",
|
||||
vec![module.into(), location_label.into()],
|
||||
);
|
||||
|
||||
let element = generated::Crate {
|
||||
id: trap::TrapId::Key(format!("{}:{hash}", root_module_file.display())),
|
||||
name: krate
|
||||
|
||||
Reference in New Issue
Block a user