Interface TypeHierarchyProvider

The type hierarchy provider interface describes the contract between extensions and the type hierarchy feature.

interface TypeHierarchyProvider {
    prepareTypeHierarchy(document, position, token): ProviderResult<TypeHierarchyItem | TypeHierarchyItem[]>;
    provideTypeHierarchySubtypes(item, token): ProviderResult<TypeHierarchyItem[]>;
    provideTypeHierarchySupertypes(item, token): ProviderResult<TypeHierarchyItem[]>;
}

Methods

  • Provide all subtypes for an item, e.g all types which are derived/inherited from the given item. In graph terms this describes directed and annotated edges inside the type graph, e.g the given item is the starting node and the result is the nodes that can be reached.

    Parameters

    Returns ProviderResult<TypeHierarchyItem[]>

    A set of direct subtypes or a thenable that resolves to such. The lack of a result can be signaled by returning undefined or null.

  • Provide all supertypes for an item, e.g all types from which a type is derived/inherited. In graph terms this describes directed and annotated edges inside the type graph, e.g the given item is the starting node and the result is the nodes that can be reached.

    Parameters

    Returns ProviderResult<TypeHierarchyItem[]>

    A set of direct supertypes or a thenable that resolves to such. The lack of a result can be signaled by returning undefined or null.