support nested config options
If we were to support generating config options with structs then they could be structured like the following example for inlay hints.
inlay_hints: ?struct {
/// Enable type hints for variable declarations.
/// ```zig
/// test {
/// fn foo() error{OutOfMemory}!u32 {}
/// var result<u32> = try foo();
/// }
/// ```
variable_type: bool = true,
/// Enable type hints for captures.
/// ```zig
/// test {
/// var some_optional: ?u32 = 5;
/// if (some_optional) |int<u32>| {}
/// }
/// ```
capture_type: bool = true,
/// Enable type hints for anonymous struct literals.
/// ```zig
/// test {
/// const foo: struct { alpha: u32 } = .{ .alpha<u32> = 5 };
/// }
/// ```
anonymous_literal_field_type: bool = true,
/// Enable name hints for parameter names.
/// ```zig
/// test {
/// fn foo(alpha: u32, beta: []const u8) void {}
/// foo(<alpha> 5, <beta> "some string");
/// }
/// ```
parameter_name: ?struct {
/// Enable inlay hints for builtin functions.
/// ```zig
/// test {
/// @mod(<numerator> 8, <denominator> 3)
/// }
/// ```
builtin: bool = true,
/// Enable inlay hints for single argument calls.
/// ```zig
/// fn foo(a: []const u8) void {}
/// fn bar(a: []const u8, b: []const u8) void {}
/// test {
/// // single_argument=true
/// foo(<a> "");
/// bar(<a> "", <b> "");
/// // single_argument=false
/// foo("");
/// bar(<a> "", <b> "");
/// }
/// ```
single_argument: bool = true,
/// Enable inlay hints for redundant parameter names.
hide_redundant: enum {
off,
/// Hide parameter name when the argument is an identifier that matches the parameter name.
/// ```zig
/// fn func(alpha: u32) void {}
/// test {
/// var alpha: u32 = 5;
/// func(alpha);
/// func(<alpha> 5);
/// }
/// ```
same_name,
/// Hide parameter name when last token of the argument matches the parameter name.
/// ```zig
/// fn func(alpha: u32) void {}
/// test {
/// const alpha: u32 = 5;
/// const beta: u32 = 5;
/// const s = .{ .alpha = 5, .beta = 5 };
///
/// func(alpha);
/// func(<alpha> &beta);
///
/// func(foo.alpha);
/// func(<alpha> foo.beta);
///
/// func(&alpha);
/// func(<alpha> &beta);
/// }
/// ```
same_last_token,
} = .off,
} = .{},
} = .{},
same_name and same_last_token aren't mutually exclusive though, should be bools?
same_nameandsame_last_tokenaren't mutually exclusive though, should bebools?
So could you give an example where same_name applies but same_last_token doesn't.
same_nameandsame_last_tokenaren't mutually exclusive though, should bebools?So could you give an example where
same_namebutsame_last_tokendoesn't.
I were going off of the current implementation, but as proposed the only token could be considered the last token :)
Current:
'inlay_hints_hide_redundant_param_names_last_token' to 'true' others default
I should have checked this but the func(alpha) case just doesn't make any sense to me.