mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 13:39:36 +07:00
Make creating resolve context with explicit type eval context shorter
GitOrigin-RevId: 7dce0f1869ca114d729f8368273291940eda21ef
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ee5a2bf513
commit
7b8b5bb12f
@@ -45,6 +45,11 @@ public final class PyResolveContext {
|
||||
return ourDefaultContext;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static PyResolveContext defaultContext(@NotNull TypeEvalContext context) {
|
||||
return ourDefaultContext.withTypeEvalContext(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow searching for dynamic usages based on duck typing and guesses during resolve.
|
||||
*
|
||||
@@ -55,11 +60,26 @@ public final class PyResolveContext {
|
||||
return ourImplicitsContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow searching for dynamic usages based on duck typing and guesses during resolve.
|
||||
*
|
||||
* Note that this resolve context is slower than the default one. Use it only for one-off user actions.
|
||||
*/
|
||||
@NotNull
|
||||
public static PyResolveContext implicitContext(@NotNull TypeEvalContext context) {
|
||||
return ourImplicitsContext.withTypeEvalContext(context);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static PyResolveContext noProperties() {
|
||||
return ourNoPropertiesContext;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static PyResolveContext noProperties(@NotNull TypeEvalContext context) {
|
||||
return ourNoPropertiesContext.withTypeEvalContext(context);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PyResolveContext withTypeEvalContext(@NotNull TypeEvalContext context) {
|
||||
return new PyResolveContext(myAllowImplicits, myAllowProperties, myAllowRemote, context);
|
||||
|
||||
Reference in New Issue
Block a user