Description
Issue #2001 is about documenting extensions themselves at the point they are defined. That's canonical "place" for an extension's docs.
One concern some users have is that users will run into this scenario.
- They see some code like
foo.bar()
. They want to know whatbar()
is. - They know
foo
is a Foo, so they look up the API docs for Foo. - No
bar()
.
What they don't realize is that bar()
is an extension method defined elsewhere. In the general case, this can't be solved. Users can define extensions on types outside of their own packages, even on core library types or non-class types that have no docs.
But in many cases, the type the extension applies to is a class in the same package where the extension itself is defined. In those cases, it would be nice if the dartdoc for that class could cross-link to the relevant extensions. For example, the C# docs for the IEnumerable interface have a section for extension methods the .NET core library defines on that type.
cc @mit-mit