File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,13 @@ register_builtin! {
6262}
6363
6464fn to_line_number ( db : & dyn AstDatabase , file : HirFileId , pos : TextUnit ) -> usize {
65- // FIXME: Use expansion info
6665 let file_id = file. original_file ( db) ;
66+
67+ // FIXME: if the file is coming from macro, we return a dummy value for now.
68+ if file. call_node ( db) . map ( |it| it. file_id != file_id. into ( ) ) . unwrap_or ( true ) {
69+ return 0 ;
70+ }
71+
6772 let text = db. file_text ( file_id) ;
6873 let mut line_num = 1 ;
6974
@@ -150,8 +155,11 @@ fn option_env_expand(
150155}
151156
152157fn to_col_number ( db : & dyn AstDatabase , file : HirFileId , pos : TextUnit ) -> usize {
153- // FIXME: Use expansion info
154158 let file_id = file. original_file ( db) ;
159+ // FIXME: if the file is coming from macro, we return a dummy value for now.
160+ if file. call_node ( db) . map ( |it| it. file_id != file_id. into ( ) ) . unwrap_or ( true ) {
161+ return 0 ;
162+ }
155163 let text = db. file_text ( file_id) ;
156164
157165 let pos = pos. to_usize ( ) ;
You can’t perform that action at this time.
0 commit comments