public LookupResult Lookup(NameSyntax name, Package fromPackage) { return(name.Match().Returning <LookupResult>() .With <QualifiedNameSyntax>(qualifiedName => { var context = Lookup(qualifiedName.Left, fromPackage); return context.Lookup(qualifiedName.Right, fromPackage); }) .With <IdentifierNameSyntax>(i => Lookup(i, fromPackage)) .Exhaustive()); }