When a warning for "Fields of ‘SomeRecord’ not initialised: a, b, c, d" fires, I'd like a CodeAction that allows it to initialize all of those rows with typed holes.
Flow would look like this:
The reason that this is somewhat of a big deal is that in the presence of long record names with the conventional prefix based row names (someRecordA, someRecordB, ...), the typing for this is nontrivial and also entirely mechanical and so the editor is perfectly capable of doing this for me.
More sophisticated versions of this could infer what fields are already initialized, and only supply the ones that are missing in this way.
Is this something that belongs in ghcide or hls?
Even cooler would be, agda supports straight up introducing the entire record.
So
0.
thing :: SomeRecordType
thing = _
thing :: SomeRecordType
thing =
SomeRecordType
{ field1 = _
, ...
}
I would say that i could be done in a plugin in hls, but not sure.
@googleson78 yeah that's also great. That said, when the typedef expands (like many records do over time), I'd still like to be able to introduce the missing fields.
Most helpful comment
Even cooler would be, agda supports straight up introducing the entire record.
So
0.