ziglang/vscode-zig

Enable text wrapping for large struct creation

qdwang opened this issue · 2 comments

const basic_info = JXL.JxlBasicInfo{ .xsize = width, .intrinsic_xsize = width, .ysize = height, .intrinsic_ysize = height, .bits_per_sample = bps, .num_color_channels = 3, .orientation = 1 };

Currently, these kinds of large struct creation will be forced to be in one line for auto formatting.

An option to enable wrap the struct like:

    const basic_info = JXL.JxlBasicInfo{ 
        .xsize = width, 
        .intrinsic_xsize = width, 
        .ysize = height, 
        .intrinsic_ysize = height, 
        .bits_per_sample = bps, 
        .num_color_channels = 3, 
        .orientation = 1 
    };

will be good.

Vexu commented

Add a comma after the last initializer and format the file. Same works for function arguments and other comma separated lists.

Add a comma after the last initializer and format the file. Same works for function arguments and other comma separated lists.

Would like the option to add commas automatically