zls icon indicating copy to clipboard operation
zls copied to clipboard

Inlay hints for struct initialization

Open Techatrix opened this issue 2 years ago • 0 comments

Everything in the angle brackets (<this>) represent a inlay hint.

Hovering over alpha in the struct init can already show the type, so adding a type hint should be easy to do.

const foo: struct { alpha: u32 } = .{ .alpha<u32> = 5 };

These type hints may be a bit harder to implement.

const foo: struct { u32, []const u8 } = .{ <u32>3, <[]const u8>"" };
const alpha: u32, const beta: []const u8 = .{ <u32>3, <[]const u8>"" };

Techatrix avatar Oct 16 '23 04:10 Techatrix