Open jasagredo opened 1 year ago
So, my read of the case with the named field is that we (reasonably) look for references of the name. But I think it would in fact be helpful to treat a pattern match that doesn't use the field name as an implicit reference to the field name.
It would be cool to be able to find uses of a non-named field, but it seems hard to express that that's what you want instead of references to the type name.
Is your enhancement request related to a problem? Please describe.
When exploring a codebase it is often useful to see where a field is being used either accessed or set. What I usually do is manually grep for the field name or ask HLS to find the references for me. However these two methods have their downsides, in particular none of them find the places where the record field is accessed via pattern matching.
Describe the solution you'd like
I think it would be incredibly useful if requesting for the references to a field also returned the places where the field is bound by pattern matching.
Describe alternatives you've considered
Alternative solutions/hacks I have used or have heard of:
Additional context
I created the following file and asked HLS to return references to the
field
field. I marked the found ones, however it would be awesome if every one of those usages was found by HLS:There might be a complication when using constructors where the fields are not named, as this one, where HLS reports some strange results, I guess mostly because it looks for usages of
Char
itself:However I don't expect this one to be a problem because one is forced to pattern match anyways.