-
-
Notifications
You must be signed in to change notification settings - Fork 741
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
Generate using statements inside namespaces #803
Conversation
Changed the code generation to place using statements for stub classes inside their respective namespaces This commit fixes reactiveui#784
using Xunit; | ||
using Nustache; | ||
using Nustache.Core; | ||
using Refit; // InterfaceStubGenerator looks for this |
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.
Are the items in this file going to be skipped without this line? The generator looks for the Using Refit
statement.
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.
Mea culpa - I have my editor set up to remove/sort using statements on save and I didn't notice the comment on that line. I'll re-add it.
An over-zealous remove/sort using task had removed it, but it is necessary for the tests to work Including changes to generated stub files as a result
Looks like an easy fix that'll capture many of the namespace clashes without requiring use of semantic analysis, thanks! Please add a few tests that show this working (and to prevent regressions) and I can merge it. |
…ated from one another
I added a simple test for the I could possibly add a test added to ensure the generated C# file compiles, but I'm not super familiar with Roslyn yet, and that may be too heavy-handed. |
That test is a part of it. I think a test that shows it working is useful too....so force the generated code to compensate for having two different I don't think you need to actually compile it as compiling the unit test project should trigger that code path. |
Renamed ITypeCollisionApiB's method to SomeBRequest for consistency Updated generator tests to include the Refit namespace
Thanks! |
This changes the stub generation's placement of using statements from the top of the file to inside the namespaces of each stub. It is a quick-and-dirty means to address name collisions seen in Issue #784
Please check if the PR fulfills these requirements