Contexts

object Contexts

Container for top-level definitions related to contexts.

See Contexts.Context for more details.

class Object
trait Matchable
class Any

Type members

Classlikes

final
class Context

A semantic universe for a given Classpaths.Classpath.

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.

Value members

Concrete methods

transparent inline
def ctx(using ctx: Context): Context

The implicitly available context.

The implicitly available context.

transparent inline
def defn(using ctx: Context): Definitions

Standard definitions of symbols and types.

Standard definitions of symbols and types.

def init(classpath: Classpath): Context

Creates a new Context for the given Classpaths.Classpath.

Creates a new Context for the given Classpaths.Classpath.