Skip to content

ResolutionResult

A successful resolution of a refkey.

commonScopeTScope | undefined

The lexical scope which contains both the reference and the lexical declaration. Undefined when they do not share a common scope.

fullReferencePathTScope[]

The scopes from the root to the scope of the reference.

fullSymbolPathTScope[]

The scopes from the root to scope of the lexical declaration.

lexicalDeclarationTSymbol

When the symbol is a member symbol, this is the symbol of the lexical declaration which contains this member symbol, either as one of its own member symbols, or as a member of one of its members.

When the symbol is a non-member symbol, this is the same as symbol.

memberPathTSymbol[]

When resolving a member symbol, this is the path of symbols that lead from the lexical declaration to the member symbol.

pathDownTScope[]

The scopes between the common scope and the declaration.

pathUpTScope[]

The scopes between the common scope and the reference.

symbolTSymbol

The resolved symbol. May be declared in a lexical scope or be a member symbol.

Let’s say we have the following scopes and symbols:

scope: global scope
├── scope: namespace scope 1
│ └── symbol: foo
│ └── static members
│ └── symbol: bar
└── scope: namespace scope 2
└── (resolve bar from here)

When we resolve the refkey for bar from within namespace scope 2, we will get the following resolution result:

  • targetDeclaration: symbol bar, the symbol we resolved.
  • commonScope: global scope, because this is the most specific scope that contains both the declaration and the reference.
  • pathUp: [namespace scope 2], because this is the scope between the reference and the common scope.
  • pathDown: [namespace scope 1], because this is the scope between the common scope and the declaration
  • memberPath: [foo, bar], because we resolved a member symbol and these are the symbols that lead from the base declaration to the member symbol.