| ... | ... | @@ -2459,7 +2459,7 @@ pub const SrcLoc = struct { |
| 2459 | 2459 | return nodeToSpan(tree, node_datas[asm_output].lhs); |
| 2460 | 2460 | }, |
| 2461 | 2461 | |
| 2462 | | .node_offset_for_cond, .node_offset_if_cond => |node_off| { |
| 2462 | .node_offset_if_cond => |node_off| { |
| 2463 | 2463 | const tree = try src_loc.file_scope.getTree(gpa); |
| 2464 | 2464 | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2465 | 2465 | const node_tags = tree.nodes.items(.tag); |
| ... | ... | @@ -2471,9 +2471,16 @@ pub const SrcLoc = struct { |
| 2471 | 2471 | .while_simple, |
| 2472 | 2472 | .while_cont, |
| 2473 | 2473 | .@"while", |
| 2474 | => tree.fullWhile(node).?.ast.cond_expr, |
| 2475 | |
| 2474 | 2476 | .for_simple, |
| 2475 | 2477 | .@"for", |
| 2476 | | => tree.fullWhile(node).?.ast.cond_expr, |
| 2478 | => { |
| 2479 | const inputs = tree.fullFor(node).?.ast.inputs; |
| 2480 | const start = tree.firstToken(inputs[0]); |
| 2481 | const end = tree.lastToken(inputs[inputs.len - 1]); |
| 2482 | return tokensToSpan(tree, start, end, start); |
| 2483 | }, |
| 2477 | 2484 | |
| 2478 | 2485 | .@"orelse" => node, |
| 2479 | 2486 | .@"catch" => node, |
| ... | ... | @@ -2967,12 +2974,6 @@ pub const LazySrcLoc = union(enum) { |
| 2967 | 2974 | /// The source location points to the initializer of a var decl. |
| 2968 | 2975 | /// The Decl is determined contextually. |
| 2969 | 2976 | node_offset_var_decl_init: i32, |
| 2970 | | /// The source location points to a for loop condition expression, |
| 2971 | | /// found by taking this AST node index offset from the containing |
| 2972 | | /// Decl AST node, which points to a for loop AST node. Next, navigate |
| 2973 | | /// to the condition expression. |
| 2974 | | /// The Decl is determined contextually. |
| 2975 | | node_offset_for_cond: i32, |
| 2976 | 2977 | /// The source location points to the first parameter of a builtin |
| 2977 | 2978 | /// function call, found by taking this AST node index offset from the containing |
| 2978 | 2979 | /// Decl AST node, which points to a builtin call AST node. Next, navigate |
| ... | ... | @@ -3233,7 +3234,6 @@ pub const LazySrcLoc = union(enum) { |
| 3233 | 3234 | .node_offset_var_decl_section, |
| 3234 | 3235 | .node_offset_var_decl_addrspace, |
| 3235 | 3236 | .node_offset_var_decl_init, |
| 3236 | | .node_offset_for_cond, |
| 3237 | 3237 | .node_offset_builtin_call_arg0, |
| 3238 | 3238 | .node_offset_builtin_call_arg1, |
| 3239 | 3239 | .node_offset_builtin_call_arg2, |