Skip to content

Sync namespace to folder reformats the entire document #34707

@davkean

Description

@davkean

Version Used:
2019 RTM

Steps to Reproduce:

  1. At $ run Sync namespace to folder
using System;

namespace Namespace
{
    class Program
    {
        //          Column1               Column2
        [InlineData("FooBar",             "Bar")]
        [InlineData("FooBarFooBar",       "Bar")]
        [InlineData("FooBarFooBarFooBar", "Bar")]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

Expected Behavior:

using System;

namespace Namespace.NewFolder
{
    class Program
    {
        //          Column1               Column2
        [InlineData("FooBar",             "Bar")]
        [InlineData("FooBarFooBar",       "Bar")]
        [InlineData("FooBarFooBarFooBar", "Bar")]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

Actual Behavior:

using System;

namespace Namespace.NewFolder
{
    class Program
    {
        //          Column1               Column2
        [InlineData("FooBar", "Bar")]
        [InlineData("FooBarFooBar", "Bar")]
        [InlineData("FooBarFooBarFooBar", "Bar")]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

I cannot use this feature in any test project as it breaks all tables. Why does it need to reformat the document to fix the namespace?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

    Type

    No type

    Projects

    Status

    Completed

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions