-
-
Notifications
You must be signed in to change notification settings - Fork 384
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Zig Version
0.14.1
ZLS Version
0.14.0
Client / Code Editor / Extensions
NVIM v0.11.2
Steps to Reproduce and Observed Behavior
Create an enum or union with member functions:
const TestEnum = enum(u8) {
.foo,
.bar
pub fn baz() TestEnum {
return .bar;
}
};
const TestUnion = union(enum) {
.foo,
.bar: u8,
pub fn baz(num: u8) TestUnion {
return .{ .bar = num };
}
};Now, given a function which takes a slice of thes enum/union, it won't display any LSP completions when inside the slice:
pub fn exampleUnions(comptime items: []const TestUnion) void {
_ = items;
return;
}
pub fn exampleEnums(comptime items: []const TestEnum) void {
_ = items;
return;
}
pub fn main() !void {
const testUnion = exampleUnions(&.{ . });
// ^ Start typing ".", there should be completions for .foo, .bar, .baz()
// but it doesn't display anything!
const testEnum = exampleEnums(&.{ . });
// ^ Start typing ".", there should be completions for .foo, .bar, .baz()
// but it doesn't display anything!
}Expected Behavior
It should display the field/function completion hints:
.foo.bar.baz(): TestUnion
Relevant log output
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working