Closed simonmckenzie closed 3 months ago
Hi @ChristianSauer, sorry to bother you, but does this PR look ok to you? I'm happy to discuss it if you'd like some changes to the approach.
Hi @ChristianSauer,
Checking in on this PR - will you have a chance to look at it soon? My team can't use AutomaticInterface because of this problem - it'd be great to be able to use it again!
Thanks, Simon
Ok, I finally found time to review this - sorry, was a shitty few last months for me.
Thank you @ChristianSauer. Much appreciated. All the best.
This addresses issue #50.
This is my second attempt at this - the first attempt (#49) involved excluding
IsOverride
methods, but this does not work with method shadowing, which becomes complex, since anew
method can have different accessibility to the method it shadows, and there's no direct link in the syntax tree between a shadowing method and the method it shadows.The approach I've used here is the same as the existing approach for deduplicating property definitions:
https://github.com/codecentric/net_automatic_interface/blob/218ba179f9ae7ad9b005202956444b7aa6437447/AutomaticInterface/AutomaticInterface/Builder.cs#L226-L239
The only difference is that it uses
ISymbol.ToDisplayString
to generate the deduplication key.The parameters I've used for the display string generation will create display strings like this, with just the method name and the parameter types and directions:
Hello(ref String, Int32, Double)