Auto-nesting does not work if the items are inside a folder
Steps to recreate
Put some files that are subject to auto-nesting inside a project folder (not nested yet)
Rename the file that should be auto-nested until it matches the auto-nesting criteria
=> Auto-nesting does not happen
Repeat the same when the items are direct children of the project
=> Auto-nesting works
Current behavior
Auto-nesting does not nest items in folders
Expected behavior
Auto-nesting does nest items in folders
Analysis
I think the root cause is here:
class FileNestingFactory
{
private static void ItemAdded(ProjectItem item)
{
...
if (parent == null || parent.Kind.Equals(VSConstants.ItemTypeGuid.PhysicalFile_string, StringComparison.OrdinalIgnoreCase))
RunNesting(item);
...
}
Looks like the intended behavior was: if the parent is a file, it's already nested, so skip auto-nesting. However it checks the opposite, so auto-nesting does only run if the parent is a file.
Installed product versions
Description
Auto-nesting does not work if the items are inside a folder
Steps to recreate
Current behavior
Auto-nesting does not nest items in folders
Expected behavior
Auto-nesting does nest items in folders
Analysis
I think the root cause is here:
Looks like the intended behavior was: if the parent is a file, it's already nested, so skip auto-nesting. However it checks the opposite, so auto-nesting does only run if the parent is a file.