Releases: ByronMayne/SourceGenerator.Foundations
2.0.13
What's Changed
- Removed the built in telemetry and opted to use NugetInsights by @ByronMayne in #46
- Fixed a few typos across the project by @ByronMayne in #47
Full Changelog: 2.0.12...2.0.13
2.0.12
What's Changed
- Added a telemetry event for when a NuGet package is installed by @ByronMayne in #43
- Updated the telemetry script to post events instead of traces by @ByronMayne in #44
- Fixed SourceGenerator.Foundations.Contracts not having an icon by @ByronMayne in #45
Full Changelog: 2.0.11...2.0.12
2.0.11
Mostly just small internal changes
What's Changed
- Updated the NuGet packages to use central versions by @ByronMayne in #41
- Adjusted so all exception handling happens in the base generator class by @ByronMayne in #42
Full Changelog: 2.0.10...2.0.11
2.0.10
Replaced SgfGeneratorAttribute
with IncrementalGeneratorAttribute
Both attributes will work and be backwards compatible but previous version will now show a warning. This was down just to clear up the ambiguous nature of the old attribute
using Sgf
// From
[SgfGenerator]
public class MyGenerator : IncrementalGenerator
{}
// To:
[IncrementalGenerator]
public class MyGenerator : IncrementalGenerator
{}
Exposed ExceptionHandler
in IncrementalGenerator
Exposed new event in the base generator task for handling exceptions. This was done to support better unit testing by allowing for handling of any exception.
public void Processs(IncrementalGenerator generator)
{
generator.ExceptionHandler += OnException;
}
public void OnException(Exception exception)
{}
New Context Interfaces
I created ISgfInitializationContext
which is implemented by SgfInitializationContext
and ISgfSourceProductionContext
which is implemented by SgfSourceProductionContext
. This was done to allow for writing more unit tests and was a request from the community. In addition for advanced uses cases you can cast the structs as their respective interface and get access to their backing fields. This should only need to be done in advanced use cases.
using SGF;
[IncrementalGenerator]
public class MyGenerator : IncrementalGenerator
{
public override void OnInitialize(SgfInitializationContext context)
{
// Get access to the original context that the SGF wraps.
ISgfInitializationContext sgfContext = (ISgfInitializationContext)context;
IncrementalGeneratorInitializationContext originalContext = sgfContext.OriginalContext;
}
}
What's Changed
- Exposed new interfaces for the Context types and exposed access to the wrapped types by @ByronMayne in #38
- Changed the class attribute for marking generators by @ByronMayne in #39
- Exposed 'ExceptionHandler' event in IncrementalGenerator to write simpler unit tests by @ByronMayne in #40
Full Changelog: 2.0.9...2.1.0
2.0.9
What's Changed
- Created new unit tests to validate banned api analyzer by @ByronMayne in #36
- Fixed the compiler error due to using the console api by @ByronMayne in #37
Full Changelog: 2.0.8...2.0.9
2.0.8
What's Changed
- Fixed the compiler error due to using the environment by @ByronMayne in #33
Full Changelog: 2.0.7...2.0.8
2.0.7
What's Changed
- Feature to turn off emitting ModuleInitializerAttribute when bringing your own polyfills by @scooter12 in #26
- Typo fixes from your friendly Grammatik-Enthusiast by @scooter12 in #28
- Added method for launching a debugger during type initialization by @ByronMayne in #31
New Contributors
- @scooter12 made their first contribution in #26
Full Changelog: 2.0.6...2.0.7
2.0.6
What's Changed
- Publishing Source.Generator.Foundations.Contracts project by @ByronMayne in #25
Full Changelog: 2.0.5...2.0.6
2.0.5
What's Changed
- Fixed a bunch of nullable warnings by @ByronMayne in #19
- Added support for unit testing the SGF Source Generators by @ByronMayne in #20
- Fixed the CI/CD being unable to publish build due to locked dlls by @ByronMayne in #22
- Fixed the compiler error for using min version of the
LangVersion
when you you uselatest
by @ByronMayne in #23
Full Changelog: 2.0.4...2.0.5
2.0.4
Bug Fixes
- Fixed a generator crash that could happen when trying to load a reference only assembly