lookupSymbolByName
This function tries to convert a Node.name into a Symbol and then performs a lookup of this symbol. This can either be an "unqualified lookup" if name is not qualified or a "qualified lookup" if Name.isQualified is true. In the unqualified case the lookup starts in startScope, in the qualified case we use extractScope to find the appropriate scope and need to restrict our search to this particular scope.
This function can return a list of multiple declarations in order to check for things like function overloading. But it will only return list of declarations within the same scope; the list cannot be spread across different scopes.
This means that as soon one or more declarations for the symbol are found in a "local" scope, these shadow all other occurrences of the same / symbol in a "higher" scope and only the ones from the lower ones will be returned.