How to apply conditional outlining

SyntaxEditor for Windows Forms Forum

Posted 11 years ago by Michael Dempsey - Sr. Developer, Teradata Corp
Version: 13.1.0311

I want to apply outlining for multiline comments - but ONLY if they do in fact span multiple lines.

I am using a dynamic language with code behind.
It works great if I open a file that already contains a multi-line comment, or paste a complete comment into the text.

However if I type a comment in normal fashion it does not display the outline unless I go back and change something on the line where the comment starts. [causing it to reparse that line]

I understand why that happens - I only set the start of an outline block if there is a matching 'end' AND it is on a different line.
Obviously that is not true when the start of the comment is typed.

I thought I could fix that by calling PerformAutomaticOutlining() for the TextRange of the '/*' [start comment] when the '*/' triggers the end outlining. However if I do that unconditionally it goes into a loop [expected].

I tried to call it conditionally based on SelectedView.DisplayLines(lineIdx).OutliningState but it seems that the Outlining State is always None.

Is this a bug, or do dynamic languages not set OutliningState?

Is there any other way to make this work?


Comments (1)

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

Hi Mike,

To properly support this, you might not be able to use that basic DynamicOutliningSyntaxLanguage outlining functionality and might have to switch to the lower-level CollapsibleNodeOutliningParser as described in the "Automatic Outlining" topic.  Check that info out.

I would expect any kind of outlining to update the display line's outlining state since I think that is what it uses to render the box and line glyphs in the renderer.

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.