Skip to content

Update to Source Generator Foundations 2.0.16#87

Merged
ByronMayne merged 2 commits into
masterfrom
feature/sgf-update
Jul 6, 2026
Merged

Update to Source Generator Foundations 2.0.16#87
ByronMayne merged 2 commits into
masterfrom
feature/sgf-update

Conversation

@ByronMayne

Copy link
Copy Markdown
Owner

This fixes the issue where AutoFactories would lose intelisense in visual studio (depending on your version) because SGF would embed Microsoft.CodeAnalysis into the assembly which would conflict with the version provided by the host of the source generator. The project would still compile but it would show errors

Vogen was causing weird compiler errors and I really did not need it's feature set
This 2.0.16 fix removes the embedding of Microsoft.CodeAnalysis which was there reason Auto Factories would loose intelisense depending on your version of Visual Studio 3
Copilot AI review requested due to automatic review settings July 6, 2026 11:32
@ByronMayne ByronMayne merged commit b2a1e42 into master Jul 6, 2026
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the source generator’s dependency stack (notably SourceGenerator.Foundations to 2.0.16) to address Visual Studio IntelliSense issues caused by Roslyn assembly version conflicts, and refactors a couple of “value object” types away from Vogen.

Changes:

  • Update SourceGenerator.Foundations (+ contracts) versions and adjust analyzer project package references.
  • Remove the MSBuild workaround target that stripped embedded Microsoft.CodeAnalysis* resources.
  • Replace Vogen-generated ViewKey / DiagnosticIdentifier types with manual implementations and update diagnostics/tests accordingly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/Directory.Build.props Removes the previous MSBuild workaround target for embedded Roslyn resources.
src/AutoFactories/ViewKey.cs Replaces Vogen value-object with a manual ViewKey struct used for templating keys.
src/AutoFactories/Diagnostics/DiagnosticIdentifier.cs Replaces Vogen value-object with a manual diagnostic ID type.
src/AutoFactories/Diagnostics/DiagnosticBuilder.cs Updates descriptor creation to use the diagnostic ID’s underlying string value.
src/AutoFactories/AutoFactories.csproj Updates/reshapes package references and bumps SourceGenerator.Foundations to 2.0.16.
src/AutoFactories.Tests/DiagnosticsTests.cs Updates assertions to compare against the diagnostic ID string values.
src/AutoFactories.Tests/AutoFactories.Tests.csproj Bumps test dependencies (Seed.IO, SGF contracts).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +28 to 32
<PackageReference Include="CodeCasing" Version="4.0.5" />
<PackageReference Include="GitVersion.MsBuild" Version="6.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Comment on lines +33 to +34
<PackageReference Include="Handlebars.Net.Helpers.Humanizer" Version="2.4.7" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" PrivateAssets="all" />
Comment on lines +35 to +37
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="5.3.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" />
<PackageReference Include="SourceGenerator.Foundations" Version="2.0.16" />
Comment on lines 5 to +9
public readonly partial struct ViewKey
{
public static ViewKey Factory = new ViewKey("FactoryView");
public static ViewKey FactoryInterface = new ViewKey("FactoryInterfaceView");
public static ViewKey ClassAttribute = new ViewKey("ClassAttribute");
Comment on lines +4 to +28
internal struct DiagnosticIdentifier
{
public static DiagnosticIdentifier UnmarkedFactory = new DiagnosticIdentifier("AF1001");
public static DiagnosticIdentifier InconsistentFactoryAccessibility = new DiagnosticIdentifier("AF1002");
public static DiagnosticIdentifier ExposedAsIsNotDerivedType = new DiagnosticIdentifier("AF1003");
public static DiagnosticIdentifier UnresolvedParameterType = new DiagnosticIdentifier("AF1004");

public readonly string Value;

private DiagnosticIdentifier(string value)
{
Value = value;
}

public static bool operator ==(DiagnosticIdentifier left, DiagnosticIdentifier right)
=> left.Value == right.Value;

public static bool operator !=(DiagnosticIdentifier left, DiagnosticIdentifier right)
=> left.Value != right.Value;

public static bool operator ==(DiagnosticIdentifier left, string right)
=> left.Value == right;

public static bool operator !=(DiagnosticIdentifier left, string right) => left.Value != right;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants