Roslyn: Automatic indentation issue with tabs

Created on 30 Oct 2019  路  3Comments  路  Source: dotnet/roslyn

Version Used:
VisualStudio.16.Release/16.3.7+29424.173
Microsoft .NET Framework Version 4.8.03752
C# Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b

Steps to Reproduce:

  1. Create C# project,
  2. Set C# editor to use the superior and one true setting, Keep tabs,
  3. Input following code:
namespace CSProjConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            switch (args.Length)
            {|CARET|}
        }
    }
}

As in:

image

  1. Press enter

Expected Behavior:

image

Actual Behavior:

image

There are 3 spaces in front of the }, which are the number of tabs that should have been inserted.

Notice that this doesn't happen if you choose the inferior setting "Insert spaces"

Most helpful comment

Spaces FTW.

Note: i fixed this here: https://github.com/dotnet/roslyn/pull/38893
Will be in the next VS update. Cheers!

All 3 comments

Spaces FTW.

Note: i fixed this here: https://github.com/dotnet/roslyn/pull/38893
Will be in the next VS update. Cheers!

Beautiful, thanks!

You're welcome!

Was this page helpful?
0 / 5 - 0 ratings