PY-21339: Use AppConfig for INSTALLED_APPS for Django 1.9+

* AppConfig added
 * #getTopLevelClasses() marked @NotNull since the only implementation is @NotNull
 * QualifiedNameResolverImpl verbosity improved
This commit is contained in:
Ilya.Kazakevich
2016-12-13 17:51:02 +03:00
parent 20629ad77c
commit 9f46e01c88
3 changed files with 3 additions and 1 deletions
@@ -27,6 +27,7 @@ import java.util.List;
public interface PyFile extends PyElement, PsiFile, PyDocStringOwner, ScopeOwner {
List<PyStatement> getStatements();
@NotNull
List<PyClass> getTopLevelClasses();
@NotNull
@@ -367,6 +367,7 @@ public class PyFileImpl extends PsiFileBase implements PyFile, PyExpression {
}
@Override
@NotNull
public List<PyClass> getTopLevelClasses() {
return PyPsiUtils.collectStubChildren(this, getStub(), PyElementTypes.CLASS_DECLARATION);
}
@@ -393,7 +393,7 @@ public class QualifiedNameResolverImpl implements RootVisitor, QualifiedNameReso
RootVisitorHost.visitSdkRoots(myContext.getSdk(), this);
}
else {
throw new IllegalStateException();
throw new IllegalStateException("Context is empty. Provide some context: module, file, sdk, etc");
}
}