Context

tastyquery.Contexts.Context
See theContext companion object
final class Context

A semantic universe for a given Classpaths.Classpath.

A Context gathers all the semantic information about symbols, types and trees that can be found in a given classpath. It represents a "universe" in which all definitions are related to each other.

It is common practice to carry a (using Context) in every method that manipulates a given universe. Virtually all methods of the tasty-query API require a given Context. The current given Context can be accessed with ctx.

The main entry point is the method findSymbolFromRoot, which gives access to a top-level symbol from its fully-qualified name path.

Another likely entry point is to use defn.RootPackage to obtain the root package package symbol, and explore everything from there using Symbols.DeclaringSymbol.getDecl and/or Symbols.DeclaringSymbol.declarations.

The same instance of Classpaths.Classpath can be reused to create several Contexts, if necessary.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def findPackage(fullyQualifiedName: String): PackageSymbol
def findStaticClass(fullyQualifiedName: String): ClassSymbol
def findStaticModuleClass(fullyQualifiedName: String): ClassSymbol
def findStaticTerm(fullyQualifiedName: String): TermSymbol
def findStaticType(fullyQualifiedName: String): TypeSymbol
def findSymbolFromRoot(path: List[Name]): Symbol

For a given classpath entry, return a lazy view over all the roots covered by the entry.

For a given classpath entry, return a lazy view over all the roots covered by the entry.

Attributes

def findTopLevelClass(fullyQualifiedName: String): ClassSymbol
def findTopLevelModuleClass(fullyQualifiedName: String): ClassSymbol

Concrete fields