Adjust Location of Outlining Node

SyntaxEditor for Windows Forms Forum

Posted 20 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
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.

Comments (5)

Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Unfortunately not with the current SemanticDefaultParser. In the next major release we will probably make available methods so that you can create your own automatic outlining routines for situations like this where SemanticDefaultParser doesn't handle things as you'd like. One use of these methods would be for writing a semantic parser base class to support XML outlining, etc.


Actipro Software Support

Posted 20 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
Thanks for the info. Do you have any plans for when the next major release might be available? I just learned about your controls and am curious how often you put out a major release.
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We're currently working on a huge overhaul of our docking window and tab controls. Once that is complete we'll be working on a major new SyntaxEditor release. You can look at the Release History in SyntaxEditor's readme file to see how often we do various releases. There are a lot of them!


Actipro Software Support

Posted 20 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
Now that you've been more involved in the changes your implementing for v2.5, can you let me know if this functionality will be supported in the next release? Thanks for the feedback!!

[ 10-05-2004: Message edited by: Boyd ]
Answer - Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes version 2.5 makes available all the methods you need to make a very low level semantic parser that doesn't have to inherit from SemanticDefaultParser. Three new methods are added that are intended for incremental updating of outlining. Now keep in mind that implementing a semantic parser is extremely complicated (SemanticDefaultParser was difficult to develop) but now you are able to make similar things happen.

Version 2.5 adds an overload of Outlining.Add which only accepts a start offset. This overload should be used for automatic outlining since as you scan through tokens, you don't know where the node ends yet.

Another new method is Outlining.Open which lets you "open" a node, meaning tell it that it has no end. This has the effect of moving all other nodes after it to be children of it.

The last new method is Outlining.Close which "closes" a node and sets an end offset to it. This has the effect of removing any child nodes that start after the specified end.

By combining those methods with Remove, you are able to make your own advanced low-level outlining.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.