Skip to content

Commit 43725e9

Browse files
committed
resolve return type of @extern
@Rexicon226 You're welcome
1 parent 6e0e7a8 commit 43725e9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/analysis.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,7 @@ fn resolveTypeOfNodeUncached(analyser: *Analyser, node_handle: NodeWithHandle) e
17931793
.{"@atomicLoad"},
17941794
.{"@atomicRmw"},
17951795
.{"@atomicStore"},
1796+
.{"@extern"},
17961797
.{"@mulAdd"},
17971798
.{"@unionInit"},
17981799
});

tests/lsp_features/completion.zig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,6 +2495,21 @@ test "@FieldType" {
24952495
});
24962496
}
24972497

2498+
test "@extern" {
2499+
try testCompletion(
2500+
\\test {
2501+
\\ const S = struct {
2502+
\\ alpha: u32,
2503+
\\ };
2504+
\\ const foo = @extern(*S, .{});
2505+
\\ foo.<cursor>
2506+
\\}
2507+
, &.{
2508+
.{ .label = "*", .kind = .Operator, .detail = "S" },
2509+
.{ .label = "alpha", .kind = .Field, .detail = "u32" },
2510+
});
2511+
}
2512+
24982513
test "builtin fns return type" {
24992514
try testCompletion(
25002515
\\pub const chip_mod = struct {

0 commit comments

Comments
 (0)