improve self param detection in inlay hints (#1258)

This commit is contained in:
Techatrix
2023-06-24 01:25:12 +00:00
committed by GitHub
parent 7e19a88ad2
commit a16fb19797
2 changed files with 16 additions and 1 deletions

View File

@@ -48,6 +48,18 @@ test "inlayhints - function self parameter" {
\\const foo: Foo = .{};
\\const _ = foo.bar(<alpha>5,<beta>"");
);
try testInlayHints(
\\const Foo = struct { pub fn bar(self: Foo, alpha: u32, beta: []const u8) void {} };
\\const _ = Foo.bar(<self>undefined,<alpha>5,<beta>"");
);
try testInlayHints(
\\const Foo = struct {
\\ pub fn bar(self: Foo, alpha: u32, beta: []const u8) void {}
\\ pub fn foo() void {
\\ bar(<self>undefined,<alpha>5,<beta>"");
\\ }
\\};
);
}
test "inlayhints - builtin call" {