java.lang.Object
java.lang.Record
org.aya.ide.Resolver.XYResolver
- All Implemented Interfaces:
Function<org.aya.concrete.stmt.Stmt,,kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>> org.aya.concrete.visitor.ExprFolder<kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>>,org.aya.concrete.visitor.PatternFolder<kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>>,org.aya.concrete.visitor.StmtFolder<kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>>
- Enclosing interface:
Resolver
public static record Resolver.XYResolver(XY xy)
extends Record
implements org.aya.concrete.visitor.StmtFolder<kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>>
In short, this class resolves cursor position to PsiNameIdentifierOwner or PsiNamedElement.
This class should traverse all AnyVars, ignoring the differences between
variable declaration and variable references, unlike StmtFolder and
SyntaxHighlight.
The rationale is that users may place the cursor at the name part of a function,
a tele, an import command, etc. And we are expected to find the correct AnyVar
no matter if it is a declaration or a reference.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>foldModuleDecl(@NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> acc, @NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.resolve.context.ModuleName path) @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>foldModuleRef(@NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> acc, @NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.resolve.context.ModuleName path) @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>foldVar(@NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> targets, @NotNull org.aya.ref.AnyVar var, @NotNull org.aya.util.error.SourcePos pos, @NotNull kala.value.LazyValue<org.aya.core.term.Term> type) @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>foldVarDecl(@NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> acc, @NotNull org.aya.ref.AnyVar var, @NotNull org.aya.util.error.SourcePos pos, @NotNull kala.value.LazyValue<@Nullable org.aya.core.term.Term> type) final inthashCode()Returns a hash code value for this object.@NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>init()final StringtoString()Returns a string representation of this record class.xy()Returns the value of thexyrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.aya.concrete.visitor.ExprFolder
fold, foldParamDecl, withTermTypeMethods inherited from interface org.aya.concrete.visitor.PatternFolder
apply, fold, foldVarRef, lazyType, noType, varTypeMethods inherited from interface org.aya.concrete.visitor.StmtFolder
apply, fold, fold
-
Constructor Details
-
XYResolver
Creates an instance of aXYResolverrecord class.- Parameters:
xy- the value for thexyrecord component
-
-
Method Details
-
init
@NotNull public @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> init()- Specified by:
initin interfaceorg.aya.concrete.visitor.ExprFolder<kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>>- Specified by:
initin interfaceorg.aya.concrete.visitor.PatternFolder<kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>>
-
foldVar
@NotNull public @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> foldVar(@NotNull @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> targets, @NotNull @NotNull org.aya.ref.AnyVar var, @NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull kala.value.LazyValue<org.aya.core.term.Term> type) - Specified by:
foldVarin interfaceorg.aya.concrete.visitor.PatternFolder<kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>>
-
foldVarDecl
@NotNull public @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> foldVarDecl(@NotNull @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> acc, @NotNull @NotNull org.aya.ref.AnyVar var, @NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull kala.value.LazyValue<@Nullable org.aya.core.term.Term> type) - Specified by:
foldVarDeclin interfaceorg.aya.concrete.visitor.PatternFolder<kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>>
-
foldModuleRef
@NotNull public @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> foldModuleRef(@NotNull @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> acc, @NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.resolve.context.ModuleName path) - Specified by:
foldModuleRefin interfaceorg.aya.concrete.visitor.StmtFolder<kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>>
-
foldModuleDecl
@NotNull public @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> foldModuleDecl(@NotNull @NotNull kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>> acc, @NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.resolve.context.ModuleName path) - Specified by:
foldModuleDeclin interfaceorg.aya.concrete.visitor.StmtFolder<kala.collection.SeqView<org.aya.util.error.WithPos<org.aya.ref.AnyVar>>>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
xy
Returns the value of thexyrecord component.- Returns:
- the value of the
xyrecord component
-