-
Notifications
You must be signed in to change notification settings - Fork 232
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
[http-client-csharp] the post processor should always keep customized code as root documents #5481
[http-client-csharp] the post processor should always keep customized code as root documents #5481
Conversation
c4a9678
to
668c68b
Compare
API change check API changes are not detected in this pull request. |
…-always-keep-customized-types
...ent-csharp/generator/Microsoft.Generator.CSharp/src/PostProcessing/GeneratedCodeWorkspace.cs
Show resolved
Hide resolved
...ent-csharp/generator/Microsoft.Generator.CSharp/src/PostProcessing/GeneratedCodeWorkspace.cs
Outdated
Show resolved
Hide resolved
packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/common/Helpers.cs
Outdated
Show resolved
Hide resolved
…rp/src/PostProcessing/GeneratedCodeWorkspace.cs Co-authored-by: Wei Hu <[email protected]>
packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CSharpGen.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test?
I would love to but I did not really figured out a way that we could unit test this. |
@live1206 @JoshLove-msft I opened this issue to track adding test cases for post processor in case we forgot it in the future: #5569 |
Fixes #5441
Previously in our generator, we have two instances of
GeneratedCodeWorkspace
: one for the project that is being generated right now (the generated code project), one for the existing part of the generated library (the customized code project).This leads to an issue that in the post processor, only the generated documents are passed into the post processor, therefore the post processor actually does not know about the existence of the customized files.
This is not very correct because the generated files must need those customized files to work properly therefore they should be in the same project.
This PR refactors this part to change the structure of
GeneratedCodeWorkspace
: now we only create one instance ofGeneratedCodeWorkspace
, and the project inside it will be initialized with shared files and all the customized files in it.In this way, when we get to the post processor, it should be able to access all the necessary documents.