diff --git a/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContext.java b/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContext.java index 1301b7e655b4..773651e5e590 100644 --- a/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContext.java +++ b/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContext.java @@ -62,18 +62,11 @@ public class TypeEvalContext { return new TypeEvalContext(true, true, null); } - /** - * Create a type evaluation context for deeper and slower code analysis. - * - * Should be used only when normal analysis context is not enough for getting good results. - */ - public static TypeEvalContext deepCodeAnalysis() { - return new TypeEvalContext(false, true, null); - } - /** * Create a type evaluation context for performing analysis operations on the specified file which is currently open in the editor, * without accessing stubs. For such a file, additional slow operations are allowed. + * + * Inspections should not create a new type evaluation context. They should re-use the context of the inspection session. */ public static TypeEvalContext codeAnalysis(@Nullable PsiFile origin) { return new TypeEvalContext(false, false, origin); @@ -87,7 +80,16 @@ public class TypeEvalContext { public static TypeEvalContext codeInsightFallback() { return new TypeEvalContext(false, false, null); } - + + /** + * Create a type evaluation context for deeper and slower code insight. + * + * Should be used only when normal code insight context is not enough for getting good results. + */ + public static TypeEvalContext deepCodeInsight() { + return new TypeEvalContext(false, true, null); + } + public TypeEvalContext withTracing() { if (myTrace == null) { myTrace = new ArrayList();