var user: User = .{.name=”Daniel”} autocompletes ‘.name’
var user: User = .init(.{.name=”Daniel”} does not autocomplete ‘.name’, but does show linting afterwards.
Would be great if the second autocomplete also worked. Full code to test with:
const std = @import("std");
pub fn main(_: std.process.Init) !void {
const user1: User = .{ .name = "Daniel" }; // autocomplete and linting works
const user2: User = .init(.{ .name = "Daniel" }); // autocomplete does not work, but linting does
_ = user1;
_ = user2;
}
const User = struct {
name: []const u8,
fn init(args: struct { name: []const u8 }) User {
return .{
.name = args.name,
};
}
};
var user: User = .{.name=”Daniel”} autocompletes ‘.name’
var user: User = .init(.{.name=”Daniel”} does not autocomplete ‘.name’, but does show linting afterwards.
Would be great if the second autocomplete also worked. Full code to test with: