提交 6efbd1d0 编写于 作者: B Basoundr_ms

Bugfix 912735

     Smart Indenter was not handling all the cases, where the return is pressed twice after a comment

     The existing case handles only the case where the caret is immediately followed a token which also happens to be the end of an indent operation.

     The cases that are added:
     The premise in these cases is, the user has pressed 2 returns after a comment
     1. There are executable code after the caret which also belong to the same indent block as the caret
          Behavior : Place the caret at the column where the other executable statements of the block are placed.

     Eg:
     static void Main(string[] args)
     {
         // A
         // B

         $$
         return;
     }

     2. Inside an initializer block with the previous token being the comma token of the separation list
         Behavior - Place the caret at the column where the previous argument to the list started

     Eg:
     var s = new List<string>
                     {
                         "",
                                 "",/*sdfsdfsdfsdf*/
                                      // dfsdfsdfsdfsdf

                                 $$
                     };
 (changeset 1276027)
上级 bdb91799
......@@ -5326,7 +5326,7 @@ static void Main(string[] args)
AssertFormat(expected, code, parseOptions: parseOptions);
}
[WorkItem(956631, "DevDiv")]
[WorkItem(924172, "DevDiv")]
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
public void IgnoreSpacesInDeclarationStatementEnabled()
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册