Skip to content

ResolutionResult

A successful resolution of a refkey.

Members

commonScopeTScope | undefined

The scope which contains both the reference and the declaration.

memberPathoptionalTSymbol[]

When resolving a member symbol, this is the path of symbols that lead from the base 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

targetDeclarationTSymbol

The symbol for the resolved declaration.

Example

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

scope: global scope
├── scope: namespace scope 1
│ └── symbol: foo
│ └── static member scope
│ └── 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.