Skip to content

chore: Add support for derivedClasses metadata when implements interfaces #10632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Apr 14, 2025

This PR intended to fix a part of issue that is reported at #2531

Currently docfx generate derivedClasses metadata when inherited from class.
But derivedClasses metadata is not outputted for interface implements.

This PR add derivedClasses support for interfaces.

Additionally, Replace dictionary lookup logics to use CollectionsMarshal.GetValueRefOrAddDefault
to reduce dictionary double-lookup costs.

Test
I've manually confirmed derivedClasses metadata generation with following sample code.
And confirmed metadata is generated as expected.

namespace BuildFromProject;

public interface ISample{}

public abstract class SampleClassBase :ISample {}

public class Sample01 :ISample
{
    public int AAA{get;set;}
}

public class Sample02: ISample
{
    public int BBB{get;set;}
}

public class Sample03: SampleClassBase
{
    public int BBB{get;set;}
}

TODO
Currently derivedClasses metadata information is not rendered for interface HTML page.
It need to modify docfx templates also (by another PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant