Merge pull request #1215 from Techatrix/refactor-doc-scope

Refactor document scope generation
This commit is contained in:
Lee Cannon
2023-05-30 21:05:26 +01:00
committed by GitHub
2 changed files with 169 additions and 380 deletions

View File

@@ -300,6 +300,16 @@ test "completion - enum" {
.{ .label = "alpha", .kind = .Enum },
.{ .label = "beta", .kind = .Enum },
});
try testCompletion(
\\const E = enum {
\\ alpha,
\\ beta,
\\};
\\const foo: E = .<cursor>
, &.{
.{ .label = "alpha", .kind = .Enum },
.{ .label = "beta", .kind = .Enum },
});
}
test "completion - error union" {
@@ -463,6 +473,16 @@ test "completion - usingnamespace" {
// TODO private should not be visible
.{ .label = "private", .kind = .Function, .detail = "fn private() !void" },
});
try testCompletion(
\\const S1 = struct {
\\ usingnamespace struct {
\\ pub fn inner() void {}
\\ };
\\};
\\const foo = S1.<cursor>
, &.{
.{ .label = "inner", .kind = .Function, .detail = "fn inner() void" },
});
}
test "completion - block" {