From 1e733a8782366ef362603882e2c2823e4a8e7389 Mon Sep 17 00:00:00 2001 From: Techatrix <19954306+Techatrix@users.noreply.github.com> Date: Mon, 20 Mar 2023 20:25:00 +0100 Subject: [PATCH] fix block label completion test --- src/features/completions.zig | 6 ++++-- tests/lsp_features/completion.zig | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/features/completions.zig b/src/features/completions.zig index 20d94cc..50bcbf4 100644 --- a/src/features/completions.zig +++ b/src/features/completions.zig @@ -328,7 +328,9 @@ fn declToCompletion(context: DeclToCompletionContext, decl_handle: Analyser.Decl var allocator = context.server.arena.allocator(); const tree = decl_handle.handle.tree; - switch (decl_handle.decl.*) { + const decl = decl_handle.decl.*; + + switch (decl) { .ast_node => |node| try nodeToCompletion( context.server, context.completions, @@ -374,7 +376,7 @@ fn declToCompletion(context: DeclToCompletionContext, decl_handle: Analyser.Decl try context.completions.append(allocator, .{ .label = name, - .kind = .Variable, + .kind = if (decl == .label_decl) .Text else .Variable, .insertText = name, .insertTextFormat = .PlainText, }); diff --git a/tests/lsp_features/completion.zig b/tests/lsp_features/completion.zig index a54b0a0..149db0b 100644 --- a/tests/lsp_features/completion.zig +++ b/tests/lsp_features/completion.zig @@ -404,7 +404,6 @@ test "completion - usingnamespace" { } test "completion - block" { - if (true) return error.SkipZigTest; try testCompletion( \\const foo = blk: { \\ break :