dotnet / dotnet/docfx

[Feature Request] Display static methods separately

Open
#11,067 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

Static methods are fundamentally different from instance methods, in that they do not work on the instance itself. Since there is a semantic difference, it would make sense to list them separately in the sidebar, listing "Static Methods" before "Methods".
Static methods can also be used as factory methods, which makes showing them separated from instance methods even more sensible (creating an object is the first step in working with them) - constructors are listed separately too, after all.

I'd love to have a config option "separateStaticMethods" or something similar, which would stop mixing static methods into regular ones, listing them before instance methods both in the body of the page as well as the sidebar.
One could further argue that static methods should even be listed before properties (meaning just after constructors), because both properties and instance methods are relevant to the instance, while static methods are on more of a "meta" level.
However, I would not list them before constructors, as constructors tie into the definition of a class itself, and are thus arguably the "most important" part.

All of this is incredibly subjective, obviously.
But I'd like to have that option.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.