Merge pull request #103 from Vexu/patch-1

Correctly skip first comma in bound function snippets
This commit is contained in:
Auguste Rame 2020-06-06 14:11:38 -04:00 committed by GitHub
commit dd58d0d501
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});