
What should I change in the Pascal xml language definition to make the blocks collapsible like in c#?
What should I change in the Pascal xml language definition to make the blocks collapsible like in c#?
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.
Please log in to a validated account to post comments.