Skip to content

Commit

Permalink
Merge pull request #701 from Techatrix/semantic-token-fix
Browse files Browse the repository at this point in the history
Correctly handle var decl without equal sign
  • Loading branch information
Techatrix authored Oct 9, 2022
2 parents 3833566 + f060d09 commit f204f34
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/semantic_tokens.zig
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ fn writeNodeTokens(builder: *Builder, maybe_node: ?Ast.Node.Index) WriteTokensEr
} else {
try writeTokenMod(builder, var_decl.ast.mut_token + 1, .variable, .{ .declaration = true });
}
try writeToken(builder, var_decl.ast.mut_token + 2, .operator);
if (token_tags[var_decl.ast.mut_token + 2] == .equal) {
try writeToken(builder, var_decl.ast.mut_token + 2, .operator);
}

try callWriteNodeTokens(allocator, .{ builder, var_decl.ast.type_node });
try callWriteNodeTokens(allocator, .{ builder, var_decl.ast.align_node });
Expand Down

0 comments on commit f204f34

Please sign in to comment.