@@ -247,8 +247,8 @@ public ComponentDirectiveVisitor(string filePath, IReadOnlyList<TagHelperDescrip
247247 {
248248 // If this is a child content tag helper, we want to add it if it's original type is in scope.
249249 // E.g, if the type name is `Test.MyComponent.ChildContent`, we want to add it if `Test.MyComponent` is in scope.
250- TrySplitNamespaceAndType ( typeName , out var typeNameTextSpan , out var _ ) ;
251- typeName = GetTextSpanContent ( typeNameTextSpan , typeName ) ;
250+ TrySplitNamespaceAndType ( typeName , out var namespaceTextSpan , out var _ ) ;
251+ typeName = GetTextSpanContent ( namespaceTextSpan , typeName ) ;
252252 }
253253
254254 if ( currentNamespace != null && IsTypeInScope ( typeName , currentNamespace ) )
@@ -337,8 +337,8 @@ public override void VisitRazorDirective(RazorDirectiveSyntax node)
337337 {
338338 // If this is a child content tag helper, we want to add it if it's original type is in scope of the given namespace.
339339 // E.g, if the type name is `Test.MyComponent.ChildContent`, we want to add it if `Test.MyComponent` is in this namespace.
340- TrySplitNamespaceAndType ( typeName , out var typeNameTextSpan , out var _ ) ;
341- typeName = GetTextSpanContent ( typeNameTextSpan , typeName ) ;
340+ TrySplitNamespaceAndType ( typeName , out var namespaceTextSpan , out var _ ) ;
341+ typeName = GetTextSpanContent ( namespaceTextSpan , typeName ) ;
342342 }
343343 if ( typeName != null && IsTypeInNamespace ( typeName , @namespace ) )
344344 {
@@ -352,13 +352,13 @@ public override void VisitRazorDirective(RazorDirectiveSyntax node)
352352
353353 internal static bool IsTypeInNamespace ( string typeName , string @namespace )
354354 {
355- if ( ! TrySplitNamespaceAndType ( typeName , out var typeNamespace , out var _ ) || typeNamespace . Length == 0 )
355+ if ( ! TrySplitNamespaceAndType ( typeName , out var namespaceTextSpan , out var _ ) || namespaceTextSpan . Length == 0 )
356356 {
357357 // Either the typeName is not the full type name or this type is at the top level.
358358 return true ;
359359 }
360360
361- return @namespace . Length == typeNamespace . Length && 0 == string . CompareOrdinal ( typeName , typeNamespace . Start , @namespace , 0 , @namespace . Length ) ;
361+ return @namespace . Length == namespaceTextSpan . Length && 0 == string . CompareOrdinal ( typeName , namespaceTextSpan . Start , @namespace , 0 , @namespace . Length ) ;
362362 }
363363
364364 // Check if the given type is already in scope given the namespace of the current document.
@@ -368,13 +368,13 @@ internal static bool IsTypeInNamespace(string typeName, string @namespace)
368368 // Whereas `MyComponents.SomethingElse.OtherComponent` is not in scope.
369369 internal static bool IsTypeInScope ( string typeName , string currentNamespace )
370370 {
371- if ( ! TrySplitNamespaceAndType ( typeName , out var typeNamespaceTextSpan , out var _ ) || typeNamespaceTextSpan . Length == 0 )
371+ if ( ! TrySplitNamespaceAndType ( typeName , out var namespaceTextSpan , out var _ ) || namespaceTextSpan . Length == 0 )
372372 {
373373 // Either the typeName is not the full type name or this type is at the top level.
374374 return true ;
375375 }
376376
377- var typeNamespace = GetTextSpanContent ( typeNamespaceTextSpan , typeName ) ;
377+ var typeNamespace = GetTextSpanContent ( namespaceTextSpan , typeName ) ;
378378 var typeNamespaceSegments = typeNamespace . Split ( NamespaceSeparators , StringSplitOptions . RemoveEmptyEntries ) ;
379379 var currentNamespaceSegments = currentNamespace . Split ( NamespaceSeparators , StringSplitOptions . RemoveEmptyEntries ) ;
380380 if ( typeNamespaceSegments . Length > currentNamespaceSegments . Length )
@@ -402,8 +402,8 @@ internal static bool IsTagHelperFromMangledClass(TagHelperDescriptor tagHelper)
402402 {
403403 // If this is a child content tag helper, we want to look at it's original type.
404404 // E.g, if the type name is `Test.__generated__MyComponent.ChildContent`, we want to look at `Test.__generated__MyComponent`.
405- TrySplitNamespaceAndType ( typeName , out var typeNameTextSpan , out var _ ) ;
406- typeName = GetTextSpanContent ( typeNameTextSpan , typeName ) ;
405+ TrySplitNamespaceAndType ( typeName , out var namespaceTextSpan , out var _ ) ;
406+ typeName = GetTextSpanContent ( namespaceTextSpan , typeName ) ;
407407 }
408408 if ( ! TrySplitNamespaceAndType ( typeName , out var _ , out var classNameTextSpan ) )
409409 {
0 commit comments