aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Module.zig b/src/Module.zig
index d87c86b864..c191fd6c7b 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -2489,8 +2489,21 @@ pub const SrcLoc = struct {
const node_datas = tree.nodes.items(.data);
const node_tags = tree.nodes.items(.tag);
const node = src_loc.declRelativeToNodeIndex(node_off);
+ var buf: [1]Ast.Node.Index = undefined;
const tok_index = switch (node_tags[node]) {
.field_access => node_datas[node].rhs,
+ .call_one,
+ .call_one_comma,
+ .async_call_one,
+ .async_call_one_comma,
+ .call,
+ .call_comma,
+ .async_call,
+ .async_call_comma,
+ => blk: {
+ const full = tree.fullCall(&buf, node).?;
+ break :blk tree.lastToken(full.ast.fn_expr);
+ },
else => tree.firstToken(node) - 2,
};
const start = tree.tokens.items(.start)[tok_index];
@@ -3083,7 +3096,8 @@ pub const LazySrcLoc = union(enum) {
/// The payload is offset from the containing Decl AST node.
/// The source location points to the field name of:
/// * a field access expression (`a.b`), or
- /// * the operand ("b" node) of a field initialization expression (`.a = b`)
+ /// * the callee of a method call (`a.b()`), or
+ /// * the operand ("b" node) of a field initialization expression (`.a = b`), or
/// The Decl is determined contextually.
node_offset_field_name: i32,
/// The source location points to the pointer of a pointer deref expression,