Skip to content

ResolutionResult

A successful resolution of a refkey.

commonScopeTScope | undefinedThe 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.
lexicalDeclarationTSymbolWhen 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[]Member symbols from the lexical declaration (exclusive) to the resolved symbol (inclusive). Empty when resolving a non-member symbol.
pathDownTScope[]The scopes between the common scope and the declaration.
pathUpTScope[]The scopes between the common scope and the reference.
symbolTSymbolThe 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: [bar]
  • lexicalDeclaration: foo For deeper chains (e.g., foo.bar.baz where bar and baz are member symbols, foo is not): memberPath = [bar, baz], lexicalDeclaration = foo.