From ca409941e00cf6338fc7f41052fc98825ba6bf6e Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Thu, 31 Mar 2022 16:01:43 -0700 Subject: [PATCH] update to zig master 0.10.0-dev.1679+d227f76af --- src/analysis.zig | 10 +++++----- src/references.zig | 4 ++-- src/semantic_tokens.zig | 4 ++-- src/signature_help.zig | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/analysis.zig b/src/analysis.zig index 8b5b980..6492ee5 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -107,7 +107,7 @@ pub fn getFunctionSnippet(allocator: std.mem.Allocator, tree: Ast, func: Ast.ful const token_tags = tree.tokens.items(.tag); - var it = func.iterate(tree); + var it = func.iterate(&tree); var i: usize = 0; while (it.next()) |param| : (i += 1) { if (skip_self_param and i == 0) continue; @@ -161,7 +161,7 @@ pub fn hasSelfParam(arena: *std.heap.ArenaAllocator, document_store: *DocumentSt if (func.ast.params.len == 0) return false; const tree = handle.tree; - var it = func.iterate(tree); + var it = func.iterate(&tree); const param = it.next().?; if (param.type_expr == 0) return false; @@ -215,7 +215,7 @@ pub fn isTypeFunction(tree: Ast, func: Ast.full.FnProto) bool { } pub fn isGenericFunction(tree: Ast, func: Ast.full.FnProto) bool { - var it = func.iterate(tree); + var it = func.iterate(&tree); while (it.next()) |param| { if (param.anytype_ellipsis3 != null or param.comptime_noalias != null) { return true; @@ -723,7 +723,7 @@ pub fn resolveTypeOfNodeInternal(store: *DocumentStore, arena: *std.heap.ArenaAl var expected_params = fn_decl.ast.params.len; // If we call as method, the first parameter should be skipped // TODO: Back-parse to extract the self argument? - var it = fn_decl.iterate(decl.handle.tree); + var it = fn_decl.iterate(&decl.handle.tree); if (token_tags[call.ast.lparen - 2] == .period) { if (try hasSelfParam(arena, store, decl.handle, fn_decl)) { _ = it.next(); @@ -2600,7 +2600,7 @@ fn makeScopeInternal(allocator: std.mem.Allocator, context: ScopeContext, node_i var scope_idx = scopes.items.len - 1; errdefer scopes.items[scope_idx].decls.deinit(); - var it = func.iterate(tree); + var it = func.iterate(&tree); while (it.next()) |param| { // Add parameter decls if (param.name_token) |name_token| { diff --git a/src/references.zig b/src/references.zig index 01292f8..27cdd7b 100644 --- a/src/references.zig +++ b/src/references.zig @@ -146,7 +146,7 @@ fn symbolReferencesInternal(arena: *std.heap.ArenaAllocator, store: *DocumentSto => { var buf: [1]Ast.Node.Index = undefined; const fn_proto = ast.fnProto(tree, node, &buf).?; - var it = fn_proto.iterate(tree); + var it = fn_proto.iterate(&tree); while (it.next()) |param| { if (param.type_expr != 0) try symbolReferencesInternal(arena, store, .{ .node = param.type_expr, .handle = handle }, decl, encoding, context, handler); @@ -547,7 +547,7 @@ pub fn symbolReferences(arena: *std.heap.ArenaAllocator, store: *DocumentStore, .function => |proto| { var buf: [1]Ast.Node.Index = undefined; const fn_proto = ast.fnProto(curr_handle.tree, proto, &buf).?; - var it = fn_proto.iterate(curr_handle.tree); + var it = fn_proto.iterate(&curr_handle.tree); while (it.next()) |candidate| { if (std.meta.eql(candidate, param)) { if (curr_handle.tree.nodes.items(.tag)[proto] == .fn_decl) { diff --git a/src/semantic_tokens.zig b/src/semantic_tokens.zig index 32811fb..93a05b8 100644 --- a/src/semantic_tokens.zig +++ b/src/semantic_tokens.zig @@ -161,7 +161,7 @@ const Builder = struct { {} continue; } - + if (source[i] != '/' or source[i + 1] != '/') continue; @@ -475,7 +475,7 @@ fn writeNodeTokens(builder: *Builder, arena: *std.heap.ArenaAllocator, store: *D try writeTokenMod(builder, fn_proto.name_token, func_name_tok_type, tok_mod); - var it = fn_proto.iterate(tree); + var it = fn_proto.iterate(&tree); while (it.next()) |param_decl| { if (param_decl.first_doc_comment) |docs| try writeDocComments(builder, tree, docs); diff --git a/src/signature_help.zig b/src/signature_help.zig index b59d79a..a2ff65c 100644 --- a/src/signature_help.zig +++ b/src/signature_help.zig @@ -23,7 +23,7 @@ fn fnProtoToSignatureInfo(document_store: *DocumentStore, arena: *std.heap.Arena } else commas; var params = std.ArrayListUnmanaged(ParameterInformation){}; - var param_it = proto.iterate(tree); + var param_it = proto.iterate(&tree); while (param_it.next()) |param| { const param_comments = if (param.first_doc_comment) |dc| try analysis.collectDocComments(alloc, tree, dc, .Markdown, false)