From 0baae921edb1c5b52feebb4cdd0906138264c74c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?fn=20=E2=8C=83=20=E2=8C=A5?= <70830482+FnControlOption@users.noreply.github.com> Date: Sat, 24 Jun 2023 10:14:58 -0700 Subject: [PATCH] Add completion test --- tests/lsp_features/completion.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/lsp_features/completion.zig b/tests/lsp_features/completion.zig index 2dc25af..77d2164 100644 --- a/tests/lsp_features/completion.zig +++ b/tests/lsp_features/completion.zig @@ -509,6 +509,17 @@ test "completion - block" { , &.{ .{ .label = "blk", .kind = .Text }, // idk what kind this should be }); + + try testCompletion( + \\const S = struct { alpha: u32 }; + \\const foo: S = undefined; + \\const bar = blk: { + \\ break :blk foo; + \\}; + \\const baz = bar. + , &.{ + .{ .label = "alpha", .kind = .Field, .detail = "alpha: u32" }, + }); } fn testCompletion(source: []const u8, expected_completions: []const Completion) !void {