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! {
62
62
}
63
63
64
64
fn to_line_number ( db : & dyn AstDatabase , file : HirFileId , pos : TextUnit ) -> usize {
65
- // FIXME: Use expansion info
66
65
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
+
67
72
let text = db. file_text ( file_id) ;
68
73
let mut line_num = 1 ;
69
74
@@ -150,8 +155,11 @@ fn option_env_expand(
150
155
}
151
156
152
157
fn to_col_number ( db : & dyn AstDatabase , file : HirFileId , pos : TextUnit ) -> usize {
153
- // FIXME: Use expansion info
154
158
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
+ }
155
163
let text = db. file_text ( file_id) ;
156
164
157
165
let pos = pos. to_usize ( ) ;
You can’t perform that action at this time.
0 commit comments