@@ -105,16 +105,16 @@ test "completion - generic function" {
105105 try testCompletion (
106106 \\const S = struct { alpha: u32 };
107107 \\fn foo(comptime T: type) T {}
108- \\const s = foo(S);
109- \\const foo = s .<cursor>
108+ \\const S1 = foo(S);
109+ \\const S2 = S1 .<cursor>
110110 , &.{
111111 .{ .label = "alpha" , .kind = .Field , .detail = "alpha: u32" },
112112 });
113113 try testCompletion (
114114 \\const S = struct { alpha: u32 };
115115 \\fn foo(any: anytype, comptime T: type) T {}
116- \\const s = foo(null, S);
117- \\const foo = s .<cursor>
116+ \\const S1 = foo(null, S);
117+ \\const S2 = S1 .<cursor>
118118 , &.{
119119 .{ .label = "alpha" , .kind = .Field , .detail = "alpha: u32" },
120120 });
@@ -1082,7 +1082,9 @@ test "completion - struct init" {
10821082 \\ brefa: A,
10831083 \\ this_is_b: []const u8,
10841084 \\};
1085- \\ref(.{ .arefb = .{ .brefa = .{.<cursor>} } });
1085+ \\test {
1086+ \\ ref(.{ .arefb = .{ .brefa = .{.<cursor>} } });
1087+ \\}
10861088 , &.{
10871089 .{ .label = "arefb" , .kind = .Field , .detail = "arefb: B = 8" },
10881090 .{ .label = "this_is_a" , .kind = .Field , .detail = "this_is_a: u32 = 9" },
@@ -1121,7 +1123,9 @@ test "completion - struct init" {
11211123 \\ const Self = @This();
11221124 \\ pub fn s3(self: *Self, p0: es, p1: S2) void {}
11231125 \\};
1124- \\S3.s3(null, .{ .mye = .{} }, .{ .ref1 = .{ .ref3 = .{ .ref2 = .{ .ref1 = .{.<cursor>} } } } });
1126+ \\test {
1127+ \\ S3.s3(null, .{ .mye = .{} }, .{ .ref1 = .{ .ref3 = .{ .ref2 = .{ .ref1 = .{.<cursor>} } } } });
1128+ \\}
11251129 , &.{
11261130 .{ .label = "s1f1" , .kind = .Field , .detail = "s1f1: u8" },
11271131 .{ .label = "s1f2" , .kind = .Field , .detail = "s1f2: u32 = 1" },
@@ -1147,8 +1151,10 @@ test "completion - struct init" {
11471151 \\ const Self = @This();
11481152 \\ pub fn s3(self: Self, p0: es, p1: S1) void {}
11491153 \\};
1150- \\const iofs3 = S3{};
1151- \\iofs3.s3(.{.<cursor>});
1154+ \\test {
1155+ \\ const iofs3 = S3{};
1156+ \\ iofs3.s3(.{.<cursor>});
1157+ \\}
11521158 , &.{
11531159 .{ .label = "s1f1" , .kind = .Field , .detail = "s1f1: u8" },
11541160 .{ .label = "s1f2" , .kind = .Field , .detail = "s1f2: u32 = 1" },
0 commit comments