Open garrettlondon1 opened 3 months ago
Also, @danroth27 I think the .NET team (happy to help), should provide some prescriptive guidance around this.
It's hard to work with the .filenesting.json settings trying to get .razor, .razor.cs, .cs, and all sub .Name.cs files to group together like so
Below are my .filenesting.json settings
Prescriptive guidance from the .NET team on how to handle this nesting for maximum productivity will help the community a ton and provide advanced guidance to handle Views, code behind, viewmodels, and any other classes that should be tightly coupled to a component.
Have improved it a bit with:
@garrettlondon1 thanks for contacting us.
Moving this to the razor repo as this seems to be tooling related. As for the comment on us offering prescriptive guidance, this is an area where we normally avoid having a concrete opinion (as there are many ways) and I suspect the majority of people will not be nesting things the way you are probably doing it.
If you come up with a pattern that works for you feel free to talk about it and promote it, however in general, we don't have an opinion about this beyond the basic nesting that the IDE offers.
I suspect this bug has nothing to do with nesting, and is just a due to the .
in the filename. The method where this probably needs to be accounted for is currently pretty simple:
https://github.com/dotnet/razor/blob/main/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/IDocumentSnapshotExtensions.cs#L52-L61
Is there an existing issue for this?
Describe the bug
When nesting razor components using .filenesting.json settings, you are unable to navigate to the component using the underscore as the reference.
https://github.com/user-attachments/assets/d617d159-a635-46e0-8806-d05411d734d5
Expected Behavior
Navigating to the sub component works properly
Steps To Reproduce
Use filesettings for nesting, try to navigate to a subcomponent
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response