zls icon indicating copy to clipboard operation
zls copied to clipboard

Add bunch of properties to primitive types for casting

Open bangbangsheshotmedown opened this issue 7 months ago • 0 comments

@'s are annoying af to type

I propose the following to help:

var myf:f32 = 0.0
var myint:i32 = myf.int // <- completion: 'intFromFloat', if user validates, it becomes:

var myint:i32 = @intFromFloat(myf)|;
                                  ^
                                  |_cursor

another one:

var myint = @intFromFloat(myf).as; // <- completion: 'as', if user validates, it becomes:

var myint = @as(|, @intFromFloat(myf));
                ^
                |_cursor

bangbangsheshotmedown avatar Jun 14 '25 05:06 bangbangsheshotmedown