-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
New refactoring rename namespace by folder structure #50
Comments
This requires access to "default namespace" property, which is not currently supported. See dotnet/roslyn#3798. |
+1 Can you work it out based on the folder structure, up to the point of hitting a project file, like a .csproj in the case of C#? It would unblock this feature, and for 90% of cases I'm pretty sure that would work. |
@kieronlanning I'm afraid don't understand your proposal. How do you want to obtain default namespace? |
The default namespace is usually the project name, or in the .csproj it has |
That would mean to read and parse csproj file every time a refactoring is computed (every time before it is displayed in the context menu). |
According to dotnet/roslyn#31253, it seems the roslyn team is working on this very refactoring (a basic version of it works in VisualStudio 2019 RC). It does not seem as if they are providing a warning for it though (at least not at the moment). Would it be possible to add an analyzer to Roslynator that provides the warning (If i understand correctly, the default namespace is now exposed in the project system dotnet/roslyn#30998)? The refactoring can be used from Rosyln itself i guess. |
Uh, im afraid i was a bit too eager. It seems there is still no way to get the project context from a code analyzer. But maybe the roslyn team will turn the refactoring into an analyzer |
Hello,
Nice extensions. Is here any plan to support rename namespace by folder structure?
Thanks
The text was updated successfully, but these errors were encountered: