Skip to content

Commit

Permalink
Fix failing signature help tests for no right paren
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-krieger committed Feb 27, 2025
1 parent fbc01f1 commit aab9d31
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/features/signature_help.zig
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ pub fn getSignatureInfo(
// We start by finding the token that includes the current cursor position
const last_token = blk: {
const last_token = offsets.sourceIndexToTokenIndex(tree, absolute_index);
// Determine whether index is after the token
const passed = tree.tokens.items(.start)[last_token] < absolute_index;
switch (token_tags[last_token]) {
.l_brace, .l_paren, .l_bracket => break :blk last_token,
.comma => break :blk if (passed) last_token else last_token -| 1,
else => break :blk last_token -| 1,
}
};
Expand Down

0 comments on commit aab9d31

Please sign in to comment.