Open dngulin opened 8 months ago
Could you provide an example, please? This should generate a .csproj
file that contains a root namespace, and that namespace should be used as the root namespace for all files - any folder under the project location will be suggested as a sub-namespace of this custom root namespace.
The root namespace in the csproj file is the same as in the assembly definition. The problem is that asmdef parent directories work as namespace providers for the project files.
For example, I have two files:
Assets/Modules/Level/Code/Level.asmdef
Assets/Modules/Level/Code/Core/SampleType.cs
The asmdef has the rootNamespace: "Level"
. In that case for the SampleType
I expect to have the Level.Core
namespace, but Rider suggest the Level.Modules.Level.Code.Core
.
As a workaround I manually disable the namespace provider
property for all parent directories, but I believe it used to work without setting them.
Running into this exact problem at the moment as well
Our folder structure is _ProductName/Code/Common/SubSystem
There's an asmdef in the SubSystem folder which defines a namespace as Product.Common.SubSystem
and rider insists on namespacing that to Product.Common.SubSystem._ProductName.Code.Common.SubSystem
unless you go through every folder and untick namespace provider (you seemingly have to do this whenever a folder is added too, quite annoying)
Is there any workarounds for that?
JetBrains Rider 2024.1.2 / Unity 2022.3.30
Setting the asmdef root namespace doesn't exclude parent directories from namespace providers. So, it just sets a new namespace prefix.
As I remember, it should replace all parent directories. At least that behaviour is described in the source code comment and I believe it used to work this way.
My environment:
com.unity.ide.rider
3.0.26