@@ -1989,29 +1989,26 @@ private bool HasDescendantsWith(XamlObjectDefinition xamlObjectDefinition, Func<
1989
1989
1990
1990
var ns = GetTrimmedNamespace ( xamlType . PreferredXamlNamespace ) ; // No MarkupExtensions are defined in the framework, so we expect a user-defined namespace
1991
1991
INamedTypeSymbol ? findType ;
1992
- if ( ns != xamlType . PreferredXamlNamespace )
1993
- {
1994
- // If GetTrimmedNamespace returned a different string, it's a "using:"-prefixed namespace.
1995
- // In this case, we'll have `baseTypeString` as
1996
- // the fully qualified type name.
1997
- // In this case, we go through this code path as it's much more efficient than FindType.
1998
- var baseTypeString = $ "{ ns } .{ xamlType . Name } ";
1999
- findType = _metadataHelper . FindTypeByFullName ( baseTypeString + "Extension" ) as INamedTypeSymbol ; // Support shortened syntax
2000
- findType ??= _metadataHelper . FindTypeByFullName ( baseTypeString ) as INamedTypeSymbol ;
2001
- }
2002
- else
2003
- {
2004
- // It looks like FindType always returns null in this code path.
1992
+ if ( ns == xamlType . PreferredXamlNamespace )
1993
+ {
1994
+ // It looks like FindType always returns null in this code path.
2005
1995
// So, we avoid the costly call here.
2006
- return null ;
2007
- }
2008
-
2009
- if ( findType ? . Is ( Generation . MarkupExtensionSymbol . Value ) ?? false )
2010
- {
2011
- return findType ;
2012
- }
2013
-
2014
- return null ;
1996
+ return null ;
1997
+ }
1998
+
1999
+ // If GetTrimmedNamespace returned a different string, it's a "using:"-prefixed namespace.
2000
+ // In this case, we'll have `baseTypeString` as
2001
+ // the fully qualified type name.
2002
+ // In this case, we go through this code path as it's much more efficient than FindType.
2003
+ var baseTypeString = $ "{ ns } .{ xamlType . Name } ";
2004
+
2005
+ // Try finding the type with "Extension" suffix first, then without
2006
+ return FindMarkupExtensionType ( baseTypeString + "Extension" ) ?? FindMarkupExtensionType ( baseTypeString ) ;
2007
+ }
2008
+
2009
+ private INamedTypeSymbol ? FindMarkupExtensionType ( string fullTypeName )
2010
+ {
2011
+ return _metadataHelper . FindTypeByFullName ( fullTypeName ) is INamedTypeSymbol type && type . Is ( Generation . MarkupExtensionSymbol . Value ) ? type : null ;
2015
2012
}
2016
2013
2017
2014
private bool IsCustomMarkupExtensionType ( XamlType ? xamlType ) =>
0 commit comments