File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use chalk_ir::IntTy;
66use chalk_ir:: Scalar ;
77use chalk_ir:: UintTy ;
88use chalk_ir:: { FloatTy , Safety } ;
9+ use codeql_extractor:: trap:: Location ;
910use itertools:: Itertools ;
1011use ra_ap_base_db:: CrateGraph ;
1112use ra_ap_base_db:: CrateId ;
@@ -85,6 +86,22 @@ pub fn extract_crate_graph(trap_provider: &trap::TrapFileProvider, db: &RootData
8586 DefMap :: ROOT ,
8687 & mut trap,
8788 ) ;
89+ let file_label = trap. emit_file ( root_module_file) . as_untyped ( ) ;
90+ let location_label = codeql_extractor:: extractor:: location_label (
91+ & mut trap. writer ,
92+ Location {
93+ file_label,
94+ start_line : 0 ,
95+ start_column : 0 ,
96+ end_line : 0 ,
97+ end_column : 0 ,
98+ } ,
99+ ) ;
100+ trap. writer . add_tuple (
101+ "locatable_locations" ,
102+ vec ! [ module. into( ) , location_label. into( ) ] ,
103+ ) ;
104+
88105 let element = generated:: Crate {
89106 id : trap:: TrapId :: Key ( format ! ( "{}:{hash}" , root_module_file. display( ) ) ) ,
90107 name : krate
Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ class File extends Container, Impl::File {
5555 |
5656 node .getFile ( ) = this and
5757 line = [ /*loc.getStartLine(), */ loc .getEndLine ( ) ] and // ignore start locations for now as we're getting them wrong for things with a comment attached
58- not loc instanceof EmptyLocation
58+ not loc instanceof EmptyLocation and
59+ line > 0
5960 )
6061 )
6162 }
Original file line number Diff line number Diff line change 1818#-----| impl AsString for ...::X { ... }
1919#-----| -> fn as_string
2020
21- #-----| mod crate
21+ lib.rs:
22+ # 1| mod crate
2223#-----| -> mod module
2324
2425#-----| mod module
You can’t perform that action at this time.
0 commit comments