Skip to content

Releases: ByronMayne/SourceGenerator.Foundations

2.0.13

05 Jan 01:30
3de134b
Compare
Choose a tag to compare

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

03 Jan 04:06
949a27e
Compare
Choose a tag to compare

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

31 Dec 02:39
3150e23
Compare
Choose a tag to compare

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

30 Dec 03:16
c908dd7
Compare
Choose a tag to compare

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

23 Dec 19:37
3ee3678
Compare
Choose a tag to compare

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

09 Dec 03:31
795f6df
Compare
Choose a tag to compare

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

09 Dec 01:25
34708c0
Compare
Choose a tag to compare

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

Full Changelog: 2.0.6...2.0.7

2.0.6

28 Jul 23:41
59502fa
Compare
Choose a tag to compare

What's Changed

  • Publishing Source.Generator.Foundations.Contracts project by @ByronMayne in #25

Full Changelog: 2.0.5...2.0.6

2.0.5

27 Jul 22:46
e7f4be9
Compare
Choose a tag to compare

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 use latest by @ByronMayne in #23

Full Changelog: 2.0.4...2.0.5

2.0.4

21 Jun 00:47
Compare
Choose a tag to compare

Bug Fixes

  • Fixed a generator crash that could happen when trying to load a reference only assembly