Record Class LocationContext

java.lang.Object
java.lang.Record
org.ek9lang.mcp.oracle.LocationContext

public record LocationContext(CompilableSource source, ParsedModule parsedModule, Optional<ISymbol> symbol, List<IScope> scopeChain, Optional<ISymbol> enclosingMethod, Optional<IAggregateSymbol> enclosingAggregate, ModuleScope moduleScope, Optional<IRModule> irModule) extends Record
Complete semantic context at a source location. Populated by LocationResolver, consumed by all Oracle query extractors.
  • Constructor Details

    • LocationContext

      public LocationContext(CompilableSource source, ParsedModule parsedModule, Optional<ISymbol> symbol, List<IScope> scopeChain, Optional<ISymbol> enclosingMethod, Optional<IAggregateSymbol> enclosingAggregate, ModuleScope moduleScope, Optional<IRModule> irModule)
      Creates an instance of a LocationContext record class.
      Parameters:
      source - the value for the source record component
      parsedModule - the value for the parsedModule record component
      symbol - the value for the symbol record component
      scopeChain - the value for the scopeChain record component
      enclosingMethod - the value for the enclosingMethod record component
      enclosingAggregate - the value for the enclosingAggregate record component
      moduleScope - the value for the moduleScope record component
      irModule - the value for the irModule record component
  • Method Details

    • empty

      public static LocationContext empty()
      Create an empty context when the source file cannot be found.
    • hasSymbol

      public boolean hasSymbol()
      Whether this context has a resolved symbol at the target location.
    • isValid

      public boolean isValid()
      Whether this context has a valid source and parsed module.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • source

      public CompilableSource source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • parsedModule

      public ParsedModule parsedModule()
      Returns the value of the parsedModule record component.
      Returns:
      the value of the parsedModule record component
    • symbol

      public Optional<ISymbol> symbol()
      Returns the value of the symbol record component.
      Returns:
      the value of the symbol record component
    • scopeChain

      public List<IScope> scopeChain()
      Returns the value of the scopeChain record component.
      Returns:
      the value of the scopeChain record component
    • enclosingMethod

      public Optional<ISymbol> enclosingMethod()
      Returns the value of the enclosingMethod record component.
      Returns:
      the value of the enclosingMethod record component
    • enclosingAggregate

      public Optional<IAggregateSymbol> enclosingAggregate()
      Returns the value of the enclosingAggregate record component.
      Returns:
      the value of the enclosingAggregate record component
    • moduleScope

      public ModuleScope moduleScope()
      Returns the value of the moduleScope record component.
      Returns:
      the value of the moduleScope record component
    • irModule

      public Optional<IRModule> irModule()
      Returns the value of the irModule record component.
      Returns:
      the value of the irModule record component