Title
For simple cases, comments get copied just fine from an interface a class implements.
But if the interface is a generic type, e.g.
public interface IInterface<TSomething>
it does not work.
Functional impact
The result is, the documentation summary does not get copied from the interface to the actual implementation
Minimal repro steps
- create an interface which has a generic type,
- implement it in a class,
- document a method of the interface
- add to the implementation
Expected result
Summary should be copied over to the implementation
Actual result
Nothing shows up in the generated doc for the implemented class.
Further technical details
After digging into the code, the issue is that when you iterate the "Implements" collection, the IDs used are generated slightly differently than the ones compared against (when trying to find the interface's documentation data).
VisitorHelper.GetCommentId(symbol) generates IDs like ClassName´1
but
for the implementation lookup, SpecIdHelper.GetSpecId(symbol, typeGenericParameters, methodGenericParameters); is used, which generates IDs which look like ClassName{{T}}
That's why context.Members.TryGetValue right here never returns anything.
Hope that makes sense
Title
For simple cases, comments get copied just fine from an interface a class implements.
But if the interface is a generic type, e.g.
it does not work.
Functional impact
The result is, the documentation summary does not get copied from the interface to the actual implementation
Minimal repro steps
Expected result
Summary should be copied over to the implementation
Actual result
Nothing shows up in the generated doc for the implemented class.
Further technical details
After digging into the code, the issue is that when you iterate the "Implements" collection, the IDs used are generated slightly differently than the ones compared against (when trying to find the interface's documentation data).
VisitorHelper.GetCommentId(symbol)generates IDs like ClassName´1but
for the implementation lookup,
SpecIdHelper.GetSpecId(symbol, typeGenericParameters, methodGenericParameters);is used, which generates IDs which look like ClassName{{T}}That's why
context.Members.TryGetValueright here never returns anything.Hope that makes sense