@@ -162,19 +162,15 @@ private void DoInitialize()
162162 }
163163
164164 // Determine if ASP.NET is used.
165- if ( ! useAspNetCoreDlls )
166- {
167- useAspNetCoreDlls =
168- IsGroupMatch ( line , ProjectSdk ( ) , "Sdk" , "Microsoft.NET.Sdk.Web" ) ||
169- IsGroupMatch ( line , FrameworkReference ( ) , "Include" , "Microsoft.AspNetCore.App" ) ;
170- }
165+ useAspNetCoreDlls = useAspNetCoreDlls
166+ || IsGroupMatch ( line , ProjectSdk ( ) , "Sdk" , "Microsoft.NET.Sdk.Web" )
167+ || IsGroupMatch ( line , FrameworkReference ( ) , "Include" , "Microsoft.AspNetCore.App" ) ;
168+
171169
172170 // Determine if implicit usings are used.
173- if ( ! useImplicitUsings )
174- {
175- useImplicitUsings = line . Contains ( "<ImplicitUsings>enable</ImplicitUsings>" . AsSpan ( ) , StringComparison . Ordinal ) ||
176- line . Contains ( "<ImplicitUsings>true</ImplicitUsings>" . AsSpan ( ) , StringComparison . Ordinal ) ;
177- }
171+ useImplicitUsings = useImplicitUsings
172+ || line . Contains ( "<ImplicitUsings>enable</ImplicitUsings>" . AsSpan ( ) , StringComparison . Ordinal )
173+ || line . Contains ( "<ImplicitUsings>true</ImplicitUsings>" . AsSpan ( ) , StringComparison . Ordinal ) ;
178174
179175 // Find all custom implicit usings.
180176 foreach ( var valueMatch in CustomImplicitUsingDeclarations ( ) . EnumerateMatches ( line ) )
@@ -187,9 +183,10 @@ private void DoInitialize()
187183 }
188184
189185 // Determine project structure:
190- isLegacyProjectStructureUsed |= MicrosoftCSharpTargets ( ) . IsMatch ( line ) ;
191- isNewProjectStructureUsed |= ProjectSdk ( ) . IsMatch ( line ) ;
192- isNewProjectStructureUsed |= FrameworkReference ( ) . IsMatch ( line ) ;
186+ isLegacyProjectStructureUsed = isLegacyProjectStructureUsed || MicrosoftCSharpTargets ( ) . IsMatch ( line ) ;
187+ isNewProjectStructureUsed = isNewProjectStructureUsed
188+ || ProjectSdk ( ) . IsMatch ( line )
189+ || FrameworkReference ( ) . IsMatch ( line ) ;
193190 // TODO: we could also check `<Sdk Name="Microsoft.NET.Sdk" />`
194191 }
195192 }
0 commit comments