correctly skip first comma in bound function snippets

This commit is contained in:
Veikka Tuominen 2020-06-06 10:35:59 +03:00 committed by GitHub
parent 73b58abe51
commit da170c44b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,7 +89,7 @@ pub fn getFunctionSnippet(allocator: *std.mem.Allocator, tree: *ast.Tree, func:
for (func.paramsConst()) |param, param_num| { for (func.paramsConst()) |param, param_num| {
if (skip_self_param and param_num == 0) continue; if (skip_self_param and param_num == 0) continue;
if (param_num != 0) try buffer.appendSlice(", ${") else try buffer.appendSlice("${"); if (param_num != @boolToInt(skip_self_param)) try buffer.appendSlice(", ${") else try buffer.appendSlice("${");
try buf_stream.print("{}:", .{param_num + 1}); try buf_stream.print("{}:", .{param_num + 1});