use of com.jetbrains.python.psi.impl.PyPsiUtils in project intellij-community by JetBrains.
the class ScopeImpl method getNamedElements.
@NotNull
@Override
public Collection<PsiNamedElement> getNamedElements(String name, boolean includeNestedGlobals) {
if (myNamedElements == null) {
collectDeclarations();
}
if (myNamedElements.containsKey(name)) {
final Collection<PsiNamedElement> elements = myNamedElements.get(name);
elements.forEach(PyPsiUtils::assertValid);
return elements;
}
if (includeNestedGlobals && isGlobal(name)) {
for (Scope scope : myNestedScopes) {
final Collection<PsiNamedElement> globals = scope.getNamedElements(name, true);
if (!globals.isEmpty()) {
globals.forEach(PyPsiUtils::assertValid);
return globals;
}
}
}
return Collections.emptyList();
}
Aggregations