Search in sources :

Example 1 with ScopeImpl

use of com.jetbrains.python.codeInsight.dataflow.scope.impl.ScopeImpl in project intellij-community by JetBrains.

the class ControlFlowCache method getScope.

@NotNull
public static Scope getScope(@NotNull ScopeOwner element) {
    SoftReference<Scope> ref = element.getUserData(SCOPE_KEY);
    Scope scope = SoftReference.dereference(ref);
    if (scope == null) {
        scope = new ScopeImpl(element);
        element.putUserData(SCOPE_KEY, new SoftReference<>(scope));
    }
    return scope;
}
Also used : Scope(com.jetbrains.python.codeInsight.dataflow.scope.Scope) ScopeImpl(com.jetbrains.python.codeInsight.dataflow.scope.impl.ScopeImpl) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Scope (com.jetbrains.python.codeInsight.dataflow.scope.Scope)1 ScopeImpl (com.jetbrains.python.codeInsight.dataflow.scope.impl.ScopeImpl)1 NotNull (org.jetbrains.annotations.NotNull)1