mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
[PY-75831] library cache should work correctly for PsiFiles created specially for completion.
GitOrigin-RevId: 4ed0ca563aad0f750901f0d6c8ca73f7ee223b8b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
447a7d0891
commit
03c367e414
@@ -52,7 +52,6 @@ public sealed class TypeEvalContext {
|
||||
|
||||
protected final Map<PyTypedElement, PyType> myEvaluated = createMap();
|
||||
protected final Map<PyCallable, PyType> myEvaluatedReturn = createMap();
|
||||
@ApiStatus.Internal
|
||||
protected final Map<Pair<PyExpression, Object>, PyType> contextTypeCache = createMap();
|
||||
/**
|
||||
* AssumptionContext invariant requires that if type is in the map,
|
||||
@@ -249,7 +248,12 @@ public sealed class TypeEvalContext {
|
||||
}
|
||||
|
||||
private @NotNull TypeEvalContext getLibraryContext(@NotNull Project project) {
|
||||
return project.getService(TypeEvalContextCache.class).getLibraryContext(new LibraryTypeEvalContext(getConstraints()));
|
||||
TypeEvalConstraints constraints = new TypeEvalConstraints(myConstraints.myAllowDataFlow,
|
||||
myConstraints.myAllowStubToAST,
|
||||
myConstraints.myAllowCallContext,
|
||||
// code completion will always have a new PsiFile, use original file instead
|
||||
myConstraints.myOrigin != null ? myConstraints.myOrigin.getOriginalFile() : null);
|
||||
return project.getService(TypeEvalContextCache.class).getLibraryContext(new LibraryTypeEvalContext(constraints));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user