PY-75831 tests for split cache(resolve/type) into library and user part

(cherry picked from commit ca5f003693960b25d78bda050b55fe39900be5a7)

IJ-MR-169158

GitOrigin-RevId: 759cb38f76124b5b0709757e8f73ddffbf4a8248
This commit is contained in:
Mikhail Golubev
2025-07-14 22:37:55 +02:00
committed by intellij-monorepo-bot
parent 31991b70bd
commit fd4360b032
13 changed files with 102 additions and 7 deletions

View File

@@ -23,7 +23,6 @@ jvm_library(
"//python/python-ast:ast",
"//python/python-syntax-core:syntax-core",
"@lib//:kotlin-stdlib",
"//platform/platform-api:ide",
],
exports = [
"//python/python-parser:parser",

View File

@@ -20,6 +20,5 @@
<orderEntry type="module" module-name="intellij.python.syntax.core" />
<orderEntry type="library" name="kotlin-stdlib" level="project" />
<orderEntry type="module" module-name="intellij.platform.backend" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.platform.ide" />
</component>
</module>

View File

@@ -99,7 +99,7 @@ public sealed class TypeEvalContext {
* the analyzed code was called or may be called. Since this is basically guesswork, the results should be used only for code completion.
*/
public static @NotNull TypeEvalContext codeCompletion(final @NotNull Project project, final @Nullable PsiFile origin) {
if (Registry.is("python.use.library.leve.type.eval.context")) {
if (Registry.is("python.use.separated.libraries.type.cache")) {
return new LibraryLongLiveTypeEvalContext(true, true, true, origin);
}
return getContextFromCache(project, new TypeEvalContext(true, true, true, origin));
@@ -113,7 +113,7 @@ public sealed class TypeEvalContext {
* For code completion see {@link TypeEvalContext#codeCompletion(Project, PsiFile)}.
*/
public static TypeEvalContext userInitiated(final @NotNull Project project, final @Nullable PsiFile origin) {
if (Registry.is("python.use.library.leve.type.eval.context")) {
if (Registry.is("python.use.separated.libraries.type.cache")) {
return new LibraryLongLiveTypeEvalContext(true, true, false, origin);
}
return getContextFromCache(project, new TypeEvalContext(true, true, false, origin));