-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve detection of IStructId namespace from compilation #52
Conversation
The existing approach of using analyzer config options breaks if there are transitive project references involved, since the options will contain potentially the wrong namespace (the one for the project being built rather than the one where IStructId actually exists). This changes the approach to looking up the types by their metadata name plus a codegen attribute which we assume users won't be using for their own code (even if they do happen to use `IStructId` for some other purpose).
🧪 Details on Ubuntu 22.04.5 LTS✅ StructId.CodeTemplateTests.AddsStructIdNamespace 🧪 Details on Microsoft Windows 10.0.20348✅ StructId.CodeTemplateTests.AddsStructIdNamespace from dotnet-retest v0.6.3 on .NET 8.0.11 with 💜 |
The existing approach of using analyzer config options breaks if there are transitive project references involved, since the options will contain potentially the wrong namespace (the one for the project being built rather than the one where IStructId actually exists).
This changes the approach to looking up the types by their metadata name plus a codegen attribute which we assume users won't be using for their own code (even if they do happen to use
IStructId
for some other purpose).