Posted 16 years ago by Markus Alexander - Austria
Version: 4.0.0277
Avatar
Hello,

In our SyntaxLanguage we have Tokens, that represent a path through a tree structure. These Tokens can be used in functions and expressions. As these tokens can have a very longtext, it would be very nice to be able to collapse them.

eg.:

Sum(|+| Variable1, 10) is collapsed
Sum(|-| Tree/Group1/Variable1, 10) would be expanded

Is this somehow possible with the current release of SyntaxEditor?

TIA
Markus Alexander

Comments (3)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Markus,

The outlining mechanism of SyntaxEditor is pretty open-ended so really it can support outlining for anything.

If you are using a dynamic language, then the default outlining mechanism (where we do the hard work of updating the outlining) does outlining based on various token pairs. Like for C# it looks for { and } tokens. There are several samples of that in the sample project in the dynamic language code-behind files.

For languages where you do more advanced parsing and create ASTs, we have a mechanism like in the Simple language sample that takes the AST and can build outlining nodes from that.

The final option is to write your own outlining mechanism by calling the various methods on our Outlining class however I will warn you, it's pretty tricky to do it right. So that's why I would recommend one of the two above approaches instead.


Actipro Software Support

Posted 16 years ago by Markus Alexander - Austria
Avatar
Hello,

yes I have seen the possibilities of the outlining, but I am wondering (or needing) the possibility to collapse tokens in the middle of a line, not like in the examples of c#.

an example would be;

collapsed
if (|+|value = true) {

}

expanded
if (|-|tree/temp/value = true) {

}

Thanks
Markus Alexander
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Well the outlining node toggle boxes must appear in the margin area, not within text flow. If you mean you want the +/- where you indicate in your code example, that isn't possible.

However any outlining node can cover characters on a single line if that is what you are asking. By that I mean outlining nodes don't have to span more than one line.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.