Previously the Module would parse a type name into scope and base name during a lookup and only give the SymbolFile plugin the base name, then it would filter the results down into the match set based on whether it was supposed to be an exact match.
However, if this is supposed to be an exact match, a SymbolFile can do this lookup in O(1) time by using its internal accelerator tables, but it can't do this unless it actually receives the full name as well as the information that it is supposed to be an exact match. Rather than being too smart, we should just let the symbol file plugin be the arbiter to decide how it wants to do lookups, so we should pass it the full name.
I'm trying to keep this as NFC for the DWARF plugin, so I took the code that was in Module.cpp and tried to rewrite it to be equivalent at the top of SymbolFileDWARF::FindTypes
GetTypeScopeAndBasename's behavior is not well documented. It has a bool return which should mean some kind of failure. The code you are replacing checks for type_basename.empty() and the type_class not being set, and falls back on the input name if it is. You unconditionally use type_basename.
The old code's test doesn't actually accord with the current behavior of GetTypeScopeAndBasename, which will only leave basename empty if the input name was empty, so far as I can see. So I don't think your version is wrong, but it is right only by accident. If we are going to rely on this behavior then it's probably a good idea to document it in the definition of GetTypeScopeAndBasename. Or go back to checking whether type_basename is empty...
Also, by not calling GetTypeScopeAndBasename before you call FindTypes_Impl, your version of the code would pass it "struct Foo" if that's what the user typed, whereas the old code would pass "Foo" (the struct would get stripped by GetTypeScopeAndBasename). I'm not sure whether that matters, did you try 'type lookup "struct Struct"' or something like that? It doesn't look like you do that in your test cases.
Also your "exact" would call "struct ::Foo" not exact, whereas the old code would call that exact.