Skip to content

Latest commit

 

History

History
203 lines (138 loc) · 11.8 KB

File metadata and controls

203 lines (138 loc) · 11.8 KB

Changelog

v1.0.0-beta21 (2026-03-09)

Breaking Changes

  • When using the NetEscapades.EnumGenerators meta package, set EnumGenerator_PreserveAttributes=true by default, so that usage analyzers can light up in downstream projects (#241)

Features

  • Add "Force Internal" to allow forcing extension methods to be internal even for public enums (#230) Thanks @xC0dex!
  • Extend usage analyzers to nullable enum variables (#244)

Fixes

  • Scan all assemblies for "external" attributes for usage analyzers (#238)

v1.0.0-beta20 (2026-01-05)

Breaking Changes

  • Split NetEscapades.EnumGenerators package into 3 packages (#233, #234)
    • NetEscapades.EnumGenerators is a meta package, and should not be added with PrivateAssets="All" or ExcludeAssets="runtime"
    • NetEscapades.EnumGenerators.Generators contains the source generator, and can be added with private assets
    • NetEscapades.EnumGenerators.RuntimeDependencies contains optional runtime dependencies used during generation
    • Please see the readme for advice on choosing your packages: https://github.com/andrewlock/NetEscapades.EnumGenerators#package-referencing-options

Features

  • Add analyzer to detect StringBuilder.Append(enum) on enums with [EnumExtensions] or EnumExtensions<T> (#230)

Fixes

  • Fix generating invalid XML in System.Memory warnings (#228)

v1.0.0-beta19 (2026-01-05)

Fixes

  • Fix README image links

v1.0.0-beta18 (2026-01-05)

Breaking Changes

  • Add support for generating ReadOnlySpan<char> based methods when System.Memory is present (#182, #212)

Features

  • Add support for disabling number parsing using EnumParseOptions (#175)
  • Add support for automatic ToLowerInvariant and ToUpperInvariant in ToStringFast(), using SerializationOptions (#177)
  • Add Analyzers to encourage using the generated methods
    • Add analyzer to detect ToString() on enums with [EnumExtensions] or EnumExtensions (#196)
    • Extend ToStringAnalyzer to detect enum usage in string interpolation (#198)
    • Add analyzer to detect HasFlag() and suggest HasFlagFast() replacement (#199)
    • Extract the extension class and namespace in analyzers (#200)
    • Add using directive support to HasFlagAnalyzer and ToStringAnalyzer code fixes (#202)
    • Add analyzer for Enum.IsDefined() suggesting generated IsDefined method (#203)
    • Add analyzer for Enum.Parse() suggesting generated Parse method (NEEG007) (#204)
    • Add analyzer for Enum.GetNames() with generated alternative (#209)
    • Add analyzer for Enum.GetValues() with code fix to use generated method (#207)
    • Add analyzer for Enum.GetValuesAsUnderlyingType() usage (#208)
    • Add analyzer for Enum.TryParse() usage (#206)
    • Refactor analyzers to reduce some duplication (#205)
    • Disable usage analyzers by default, enable via editorconfig (#214)
    • Update default severity to warning (#218)
    • Change how the usage analyzers are enabled to use an EnumGenerator_EnableUsageAnalyzers MSBuild property instead (#222)
    • Add AnalyzerTests project to confirm that the analyzers are actually triggering warnings in a real project (#223)
    • Mention globalconfig in the docs, and tweak the detection for consistency (#224)

Fixes

  • Remove ToStringFastWithMetadata when it's not needed for perf reasons(#176)
  • Minor performance fixes in generated code (#178)
  • Use Collection expressions in generated code if possible (#179)

Misc

  • Build tweaks (#180)
  • Add support for .NET 10.0 in Benchmark project (#184) Thanks @HakamFostok!
  • Add Usage Analyzers documentation to README (#216)
  • Update Readme (#219)

v1.0.0-beta16 (2025-11-04)

Fixes

  • Fix incorrect default value of EnumGenerator_ForceExtensionMembers incorrectly generating C#14 extension members (#172) Thanks @sindrekroknes

v1.0.0-beta15 (2025-10-29)

Breaking Changes:

  • Embedding marker attributes in the target dll using NETESCAPADES_ENUMGENERATORS_EMBED_ATTRIBUTES is no longer supported (#160)
  • Only one source of metadata for enum member descriptions may be selected, [Description], [Display], or [EnumMember] (the default) (#163)

Features

  • Add analyzer warning when generated extension class would clash with other generated extension class (Dianostic NEEG001) (#158)
  • Add analyzer warning that you can't generate extensions for enum nested in a generic class (Dianostic NEEG002) (#159)
  • Add analyzer info when enum contains duplicate case labels that may give unexpected results from ToStringFast() (Dianostic NEEG003) (#162)

Fixes

  • Don't generate C#14 extension members when using LangVersion.Preview unless MSBuild property EnumGenerator_ForceExtensionMembers is set (#165)
  • Fix code generation for enum members that use C# reserved member names (#168)

v1.0.0-beta14 (2025-06-15)

Features

  • Expose generated static methods as C#14 static extension members on enums, when building with C#14 (#154)

Fixes

v1.0.0-beta13 (2025-05-11)

Features

  • Added AsUnderlyingType() and GetValuesAsUnderlyingType() (#125) Thanks @TheConstructor!

Fixes

  • Replaced multiline verbatim strings (@"") with raw string literals (#87) Thanks @Guiorgy!
  • Update GetValues, GetNames and GetValuesAsUnderlyingType to match System.Enum order (#134) Thanks @TheConstructor!
  • Directly call ToString on unnamed numeric values to reduce overhead (#135) @TheConstructor!

v1.0.0-beta12 (2025-01-26)

Breaking Changes:

  • By default, ToStringFast() no longer uses [DisplayName] and [Description] by default. The original behaviour can be restored by passing allowMatchingMetadataAttribute:true (#122)
  • Split the experimental interceptor support into a separate project, NetEscapades.EnumGenerators.Interceptors (#125)
  • Enable interception by default when NetEscapades.EnumGenerators.Interceptors is added (#127)

Features

  • Added a package logo (#125)

Fixes

  • Fixed indentation in generated code so it aligns properly with 4 spaces (#120) Thanks @karl-sjogren!
  • Fix missing global on System namespace usages (#118) Thanks @henrikwidlund!
  • Don't use usings in generated code (#129)

v1.0.0-beta11 (2024-10-24)

Features

  • Add optional interceptor for ToString() and HasFlag() (#94, #101, #104, #105, #106, #108, #113)
  • Ignore usages of obsolete enum members in generated code (#111)

Fixes

  • Fix escaping of strings in description and display attributes (#109)
  • Ensure we can handle enums with the same name in different namespaces (#114)
  • Fix naming conflicts in System namespace (#118) Thanks @henrikwidlund!

v1.0.0-beta09 (2024-05-15)

Features

  • Add support for generating extensions for external enums that come from other assemblies (#82)
  • Add support for new Parse overloads (#85)

Fixes

  • Add [GeneratedCodeAttribute] to the generated extensions (#83)
  • Split TryParse code method to try to fix coverlet issue (#84)

v1.0.0-beta08 (2023-06-05)

Fixes

  • Exclude embedded attribute from code coverage #59 (Thanks @erri120!)
  • Fix Error when a class with the same name as namespace #62
  • Support quotes and slashes in description/displayname attribute #63

v1.0.0-beta07 (2023-03-09)

Fixes

  • Add global:: prefix to System namespace references #55

v1.0.0-beta06 (2022-12-20)

Fixes

  • Fix XML comments for public generated members #49

v1.0.0-beta05 (2022-12-19)

Features

  • Add support for overriding ToStringFast() and related methods by adding [Description] attribute to members #46
  • Add support for overriding ToStringFast() and related methods by adding [Display] attribute to members #13 (thanks @adamradocz)
  • Add a .NET 4.5.1 target to the attributes dll, to reduce dependencies introduced by .NET Standard #45
  • Add parsing overloads for ReadOnlySpan<T> #16 (thanks @adamradocz)
  • Add Length extension method #7 (thanks @tothalexlaszlo)

Fixes

  • Fix HasFlagsFast() implementation #44
  • Add XML documentation for attributes 9a38580cdc9e
  • Add XML comments to public generated members and fix formatting #42
  • Fixed spelling of isDisplayAttributeUsed property #17 (thanks @JasonLautzenheiser)

Refactoring