Dreamescaper / IntelliSenseExtender

GNU General Public License v3.0
88 stars 17 forks source link

Is it possible to put the first using within the namespace instead of outside? #56

Open Chane opened 5 years ago

Chane commented 5 years ago

If there are usings currently inside the namespace the usings are added inside with the others, however if it is the first using, then they are added outside.

Is there a way to configure the default behaviour.

E.g.

Instead of:

using NUnit.Framework;

namespace MVC.Tests.TagHelpers
{
    [TestFixture]
    public class TextResourceTagHelperTest
    {

    }
}

having

namespace MVC.Tests.TagHelpers
{
    using NUnit.Framework;

    [TestFixture]
    public class TextResourceTagHelperTest
    {

    }
}

(VIsual Studio 2019 RC.1)

Dreamescaper commented 5 years ago

Currently I mostly use functionality provided by Roslyn to add usings, so it behaves same as you would add using via code fix, for instance (that was the plan, at least).

This issue tracks similar functionality in Roslyn repo: https://github.com/dotnet/roslyn/issues/27288

Dreamescaper commented 5 years ago

Seems like such configuration is added in VS2019 16.1 Preview 3, with corresponding option in editorconfig file. I'll check whether I need to adjust anything to make it account for that

Dreamescaper commented 5 years ago

So seems like that option added analyzer and code fix, but it doesn't actually affect how Add Using works. Created bug in Roslyn: https://github.com/dotnet/roslyn/issues/35803