H.Generators.Extensions 1.24.2

dotnet add package H.Generators.Extensions --version 1.24.2
                    
NuGet\Install-Package H.Generators.Extensions -Version 1.24.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="H.Generators.Extensions" Version="1.24.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="H.Generators.Extensions" Version="1.24.2" />
                    
Directory.Packages.props
<PackageReference Include="H.Generators.Extensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add H.Generators.Extensions --version 1.24.2
                    
#r "nuget: H.Generators.Extensions, 1.24.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package H.Generators.Extensions@1.24.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=H.Generators.Extensions&version=1.24.2
                    
Install as a Cake Addin
#tool nuget:?package=H.Generators.Extensions&version=1.24.2
                    
Install as a Cake Tool

H.Generators.Extensions

A set of extensions to simplify the code of generators. In addition to extensions, this library also adds a .props file to automatically add your generation-time dependencies to the NuGet package and Integration tests.

Install

The usage is pretty simple:

<PackageReference Include="H.Generators.Extensions" Version="1.4.2" PrivateAssets="all" />

I want to note that PrivateAssets="all" is required to rule out some issues.

Extensions

AnalyzerConfigOptionsProviderExtensions

  • options.GetGlobalOption(string name)
  • options.GetOption(AdditionalText, string name)
  • options.GetRequiredGlobalOption(string name)
  • options.GetRequiredOption(AdditionalText, string name)
  • options.TryRecognizeFramework()
  • options.RecognizeFramework() To recognize the framework, you will need to add the following code to your %PackageId%.props:
<Project>

  <ItemGroup>
    <CompilerVisibleProperty Include="RecognizeFramework_DefineConstants"/>
    <CompilerVisibleProperty Include="UseWPF"/>
    <CompilerVisibleProperty Include="UseWinUI"/>
    <CompilerVisibleProperty Include="UseMaui"/>
  </ItemGroup>

  <Target Name="CreateDefineConstants" BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun;GenerateMSBuildEditorConfigFileCore">

    <PropertyGroup>
      <RecognizeFramework_DefineConstants>$(DefineConstants.Replace(';',','))</RecognizeFramework_DefineConstants>
    </PropertyGroup>

  </Target>
  
</Project>

SourceProductionContextExtensions

  • context.ReportException(string id, Exception)

StringExtensions

  • name.ToPropertyName()
  • name.ToParameterName()
  • text.RemoveBlankLinesWhereOnlyWhitespaces()
  • text.NormalizeLineEndings(string? newLine = null)
  • fullTypeName.ExtractNamespace()
  • fullTypeName.ExtractSimpleName()
  • fullTypeName.WithGlobalPrefix()

EnumerableExtensions

  • values.Inject()

H.Generators.Tests.Extensions

  • DictionaryAnalyzerConfigOptions
  • DictionaryAnalyzerConfigOptionsProvider
  • MemoryAdditionalText
  • ImmutableArrayExtensions.NormalizeLocations

Support

You can get answers to your questions in my discord support channel:
https://discord.gg/g8u2t9dKgE

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on H.Generators.Extensions:

Package Downloads
WPF.DependencyPropertyGenerator

C# Source Generator library to generate DependencyProperty.

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on H.Generators.Extensions:

Repository Stars
christianhelle/refitter
A tool for generating Refit interfaces and contracts from OpenAPI specifications
HavenDV/DependencyPropertyGenerator
Dependency property, routed event and weak event source generator for WPF/UWP/WinUI/Uno/Avalonia/MAUI platforms.
Version Downloads Last Updated
1.24.2 3,173 2/26/2025
1.24.1 1,002 1/12/2025
1.24.0 2,266 11/13/2024
1.23.0 145 11/13/2024
1.22.0 13,148 11/30/2023
1.21.1 141 11/30/2023
1.21.0 151 11/30/2023
1.20.0 2,881 11/7/2023
1.19.0 2,022 9/22/2023
1.18.0 1,888 8/30/2023
1.17.1 193 8/30/2023
1.17.0 185 8/30/2023
1.16.0 1,188 8/16/2023
1.15.1 1,453 4/8/2023
1.15.0 384 3/10/2023
1.14.3 288 3/9/2023
1.14.2 392 3/9/2023
1.14.1 323 3/9/2023
1.14.0 267 3/9/2023
1.13.1 257 3/9/2023
1.13.0 263 3/9/2023
1.12.0 273 3/8/2023
1.11.0 1,911 3/6/2023
1.10.2 283 3/6/2023
1.10.1 285 3/6/2023
1.10.0 284 3/5/2023
1.9.2 712 2/16/2023
1.9.1 524 2/6/2023
1.9.0 305 2/6/2023
1.8.4 433 1/4/2023
1.8.3 843 11/19/2022
1.8.2 385 11/12/2022
1.8.1 1,013 11/1/2022
1.8.0 393 11/1/2022
1.7.7 7,155 8/1/2022
1.7.6 547 7/19/2022
1.7.5 962 7/17/2022
1.7.4 488 7/13/2022
1.7.3 468 7/13/2022
1.7.2 515 7/13/2022
1.7.1 509 7/13/2022
1.7.0 511 7/9/2022
1.6.0 807 7/8/2022
1.5.0 524 6/23/2022
1.4.2 980 6/22/2022
1.4.1 499 6/22/2022
1.4.0 503 6/22/2022
1.3.0 491 6/21/2022
1.2.0 522 6/6/2022
1.1.0 476 6/6/2022
1.0.20 487 6/1/2022
1.0.19 484 6/1/2022
1.0.18 490 5/31/2022
1.0.17 493 5/31/2022
1.0.16 459 5/31/2022
1.0.15 465 5/31/2022
1.0.14 488 5/31/2022
1.0.13 485 5/25/2022
1.0.12 475 5/25/2022
1.0.11 487 5/25/2022
1.0.10 472 5/25/2022
1.0.9 481 5/25/2022
1.0.8 480 5/25/2022
1.0.7 483 5/24/2022
1.0.6 480 5/20/2022
1.0.5 510 5/18/2022
1.0.4 489 5/18/2022
1.0.3 485 5/18/2022
1.0.2 503 5/18/2022
1.0.1 514 5/18/2022

⭐ Last 10 features:
Updated to net9
Added Net9 to LatestReferenceAssemblies.
Added extensions from DependencyPropertyGenerator.
Updated to net8.0.
Added net8.0 support for ReferenceAssemblies.
Updated Uno version in FrameworkReferenceAssemblies.
Added GeneratorDriverExtensions.
Added net7.0 reference assemblies.
Added SelectAndReportDiagnostics.
Added IncrementalValuesProvider.CollectAsEquatableArray.
🐞 Last 10 fixes:
Fixed version of Microsoft.CodeAnalysis.CSharp.
Fixed ToParameterName for C# keywords.
Updated Uno and WinAppSdk versions.
Fixed Avalonia ReferenceAssemblies.
Fixed warnings.
Added ability to add/remove _SystemLibs.
Added missing IncrementalValueProvider SelectAndReportExceptions without cancellation token.
Added IncrementalValueProvider SelectAndReportExceptions.
Added missing useful overloads.
Added IncrementalValuesProviderExtensions.WhereNotNull.