ResolutionResult
A successful resolution of a refkey.
Members
Section titled “Members”commonScope | TScope | undefined The lexical scope which contains both the reference and the lexical declaration. Undefined when they do not share a common scope. |
fullReferencePath | TScope[] The scopes from the root to the scope of the reference. |
fullSymbolPath | TScope[] The scopes from the root to scope of the lexical declaration. |
lexicalDeclaration | TSymbol 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 |
memberPath | TSymbol[] When resolving a member symbol, this is the path of symbols that lead from the lexical declaration to the member symbol. |
pathDown | TScope[] The scopes between the common scope and the declaration. |
pathUp | TScope[] The scopes between the common scope and the reference. |
symbol | TSymbol The resolved symbol. May be declared in a lexical scope or be a member symbol. |
Example
Section titled “Example”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.