mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[PY-75831] library cache should work correctly for PsiFiles created specially for completion.
GitOrigin-RevId: 0633366b2caf18a11cb7fb9802351f5db24500fe
This commit is contained in:
committed by
intellij-monorepo-bot
parent
57b05ad202
commit
1b662631cf
@@ -52,7 +52,6 @@ public sealed class TypeEvalContext {
|
|||||||
|
|
||||||
protected final Map<PyTypedElement, PyType> myEvaluated = createMap();
|
protected final Map<PyTypedElement, PyType> myEvaluated = createMap();
|
||||||
protected final Map<PyCallable, PyType> myEvaluatedReturn = createMap();
|
protected final Map<PyCallable, PyType> myEvaluatedReturn = createMap();
|
||||||
@ApiStatus.Internal
|
|
||||||
protected final Map<Pair<PyExpression, Object>, PyType> contextTypeCache = createMap();
|
protected final Map<Pair<PyExpression, Object>, PyType> contextTypeCache = createMap();
|
||||||
/**
|
/**
|
||||||
* AssumptionContext invariant requires that if type is in the map,
|
* 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) {
|
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