Posted 9 years ago by Dragos Popescu
Version: 14.1.0323

What should I change in the Pascal xml language definition to make the blocks collapsible like in c#?

Comments (1)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Dragos,

You could possibly set up the "begin" and "end" keywords to function as a token-based outlining block.  Look at the JavaDynamicSyntaxLanguage codebehind class in the sample project for an example of how outlining is set up based on tokens.  You'd do something similar for Pascal.  Also note that you need to set up a SyntaxLanguageTypeName attribute in the root element of the XML definition to tie it to a codebehind class.

The problem is that Pascal has other blocks like "case...end" that also use "end" as a keyword, which causes problems because a token-based outliner wouldn't know that the "end" keyword there is tied to a "case" vs. some other kind of higher level block.  That is why we don't have token based outlining in the samples, as it wouldn't be accurate.

You really would need a parser defined for the language to build an AST, at least of the collapsible blocks, and then build outlining off of that.  You can look at our documentation or the Simple language example for how to do some of that.  But it can get time consuming to build a parser for a full complex language like Pascal.

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.