Example usage for com.intellij.openapi.util MixinExtension getInstance

List of usage examples for com.intellij.openapi.util MixinExtension getInstance

Introduction

In this page you can find the example usage for com.intellij.openapi.util MixinExtension getInstance.

Prototype

@Nullable
    public static <T> T getInstance(ExtensionPointName<MixinEP<T>> name, Object key) 

Source Link

Usage

From source file:com.intellij.codeInsight.hint.DeclarationRangeUtil.java

License:Apache License

public static @Nullable TextRange getPossibleDeclarationAtRange(final PsiElement container) {
    DeclarationRangeHandler handler = MixinExtension.getInstance(DeclarationRangeHandler.EP_NAME, container);
    if (handler != null) {
        return handler.getDeclarationRange(container);
    } else {/*from w w  w. ja v a2  s  .c o m*/
        for (Class clazz : ourDeclarationRangeRegistry.keySet()) {
            if (clazz.isInstance(container)) {
                final DeclarationRangeHandler handler2 = ourDeclarationRangeRegistry.get(clazz);
                if (handler2 != null)
                    return handler2.getDeclarationRange(container);
            }
        }

        return null;
    }
}