Skip to content

[Question] How do I get all the INamedTypeSymbols in a given compilation? #6138

@JoshVarty

Description

@JoshVarty

I've been trying this for about 45 minutes now, but I can't seem to figure out how to get a list of all of the INamedTypeSymbol available in a given compilation. I tried digging through the Compilation.GetTypeByMetadataName stuff, but couldn't figure it out.

I tried using Compilation.GlobalNamespace.GetTypeMembers() and it seems to give me all the IModuleSymbols that are referenced by the current project. (I see mscorlib, System.Core etc.) I then tried getting the type members inside these modules, but they were either empty or contained PrivateImplementation stuff.

Is there an API to get access to all the INamedTypeSymbols available in a compilation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Concept-APIThis issue involves adding, removing, clarification, or modification of an API.QuestionResolution-AnsweredThe question has been answered

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions