-
-
Notifications
You must be signed in to change notification settings - Fork 68
Emit '[Embedded]' attribute for all polyfills #127
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
base: main
Are you sure you want to change the base?
Conversation
|
Would this work if you don't have the latest SDK or VS installed? Because according to this you couldn't declare the Also, just to have it documented here too: @MarkKharitonov found a problem with this solution, see #50 (comment) |
fb5de81 to
9877132
Compare
|
@cremor yeah this will work fine, I'm still using Roslyn 4.3.0, and not that new API that was added 🙂 |
|
I didn't mean the new API. I meant that quote from the PR dotnet/roslyn#76523:
I understand this as: If you use a compiler version before VS 17.13 then you would get an error. I haven't tested this. I just wanted to raise awareness. |
|
Small suggestion. Recent Roslyn APIs have an convenience API You could re-create this helper if you are not on the newer Roslyn packages: https://github.com/dotnet/roslyn/blob/51d2ed9e47364b57024f7715c2e2b2e385fe1454/src/Compilers/Core/Portable/SourceGeneration/IncrementalContexts.cs#L144 |
Introduces a new MSBuild property 'PolySharpUseEmbeddedAttributeForGeneratedTypes' and corresponding generation option to control whether the [Embedded] attribute is emitted and applied to generated types. Refactors the generator to emit the EmbeddedAttribute only when this option is enabled, improving flexibility and reducing unnecessary code emission.
Document and expose the new PolySharpUseEmbeddedAttributeForGeneratedTypes property in both READMEs and PolySharp.targets. This option allows generated polyfill types to be marked with the [Embedded] attribute.
Closes #50, #103
Description
This PR updates the generator to also emit the
[Embedded]attribute for polyfills, to avoid conflicts for internal types.