Search in sources :

Example 1 with SdkResolveScopeProvider

use of com.intellij.psi.SdkResolveScopeProvider in project intellij-community by JetBrains.

the class LibraryScopeCache method getScopeForSdk.

@NotNull
public GlobalSearchScope getScopeForSdk(@NotNull JdkOrderEntry jdkOrderEntry) {
    final String jdkName = jdkOrderEntry.getJdkName();
    if (jdkName == null)
        return GlobalSearchScope.allScope(myProject);
    GlobalSearchScope scope = mySdkScopes.get(jdkName);
    if (scope == null) {
        //noinspection deprecation
        for (SdkResolveScopeProvider provider : SdkResolveScopeProvider.EP_NAME.getExtensions()) {
            scope = provider.getScope(myProject, jdkOrderEntry);
            if (scope != null) {
                break;
            }
        }
        if (scope == null) {
            scope = new JdkScope(myProject, jdkOrderEntry);
        }
        return ConcurrencyUtil.cacheOrGet(mySdkScopes, jdkName, scope);
    }
    return scope;
}
Also used : SdkResolveScopeProvider(com.intellij.psi.SdkResolveScopeProvider) GlobalSearchScope(com.intellij.psi.search.GlobalSearchScope) DelegatingGlobalSearchScope(com.intellij.psi.search.DelegatingGlobalSearchScope) JdkScope(com.intellij.openapi.module.impl.scopes.JdkScope) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

JdkScope (com.intellij.openapi.module.impl.scopes.JdkScope)1 SdkResolveScopeProvider (com.intellij.psi.SdkResolveScopeProvider)1 DelegatingGlobalSearchScope (com.intellij.psi.search.DelegatingGlobalSearchScope)1 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)1 NotNull (org.jetbrains.annotations.NotNull)1