use of com.jetbrains.python.psi.stubs.PyFileStub in project intellij-community by JetBrains.
the class PyFileImpl method getDunderAll.
@Override
public List<String> getDunderAll() {
final StubElement stubElement = getStub();
if (stubElement instanceof PyFileStub) {
return ((PyFileStub) stubElement).getDunderAll();
}
if (!myDunderAllCalculated) {
final List<String> dunderAll = calculateDunderAll();
myDunderAll = dunderAll == null ? null : Collections.unmodifiableList(dunderAll);
myDunderAllCalculated = true;
}
return myDunderAll;
}
use of com.jetbrains.python.psi.stubs.PyFileStub in project intellij-community by JetBrains.
the class PyFileImpl method hasImportFromFuture.
@Override
public boolean hasImportFromFuture(FutureFeature feature) {
final StubElement stub = getStub();
if (stub instanceof PyFileStub) {
return ((PyFileStub) stub).getFutureFeatures().get(feature.ordinal());
}
Boolean enabled = myFutureFeatures.get(feature);
if (enabled == null) {
enabled = calculateImportFromFuture(feature);
myFutureFeatures.put(feature, enabled);
// NOTE: ^^^ not synchronized. if two threads will try to modify this, both can only be expected to set the same value.
}
return enabled;
}
Aggregations