Update to Source Generator Foundations 2.0.16#87
Merged
Conversation
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
There was a problem hiding this comment.
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/DiagnosticIdentifiertypes 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; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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