Posted 20 years ago
by Boyd
-
Sr. Software Developer,
Patterson Consulting, LLC
In VS.NET and C#, method declarations are automatically outlined. Regardless of which line the opening curly brace of a method body appears on, VS.NET always places the +/- outlining node on the same line as the method declaration. SyntaxEditor appears to always place the +/- outlining node on the same line as the opening curly brace. Consider the following code samples with line numbers indicated:
1: public void Example1()
2: {
3: // Curly brace on own line
4: }
1: public void Example2() {
2: // Curly brace on same line as method declaration
3: }
For both examples, VS.NET will always place the +/- outlining node on line 1. SyntaxEditor will place it on line 2 for Example 1 and line 1 for Example 2 because this is where the curly brace is located. Is it possible to get SyntaxEditor to place the +/- node for Example 1 on line 1 and still only collapse the text between the curly braces? Please let me know if you need additional information.
1: public void Example1()
2: {
3: // Curly brace on own line
4: }
1: public void Example2() {
2: // Curly brace on same line as method declaration
3: }
For both examples, VS.NET will always place the +/- outlining node on line 1. SyntaxEditor will place it on line 2 for Example 1 and line 1 for Example 2 because this is where the curly brace is located. Is it possible to get SyntaxEditor to place the +/- node for Example 1 on line 1 and still only collapse the text between the curly braces? Please let me know if you need additional information.