Unplanned
Last Updated: 10 Jul 2020 10:03 by ADMIN
Pierre
Created on: 17 Feb 2020 13:40
Category: SyntaxEditor
Type: Bug Report
3
SyntaxEditor: Foldings are incorrect when there is a missing open or close tag
Foldings are incorrect when there is a missing open or close tag.
Attached Files:
4 comments
ADMIN
Petar Mladenov
Posted on: 10 Jul 2020 10:03

Hello Pierre,

I can suggest implementing different matching modes for the FoldingTaggerBase class. The default mode will work like the current version, assuming the document folding regions are valid - equal number of start and end tags, no crossings between regions. This mode now runs in linear time which is fast (stack iteration). However, to match tags in non-valid document, code will be a bit slower (but will cover cases like yours), because of the need to check all possible end tags (and they are not ordered). So there can be at least 2 modes - 'first' and 'last' match. I am attaching here your modified project with this new API which is in development. So it can be changed over the next weeks. I would appreciate any feedback.

    var foldingTagger = new FlexFoldingTagger(this.syntaxEditor) { MatchingAlgorithm = FoldingMatchingAlgorithm.FirstMatch };

Regards,
Petar Mladenov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Pierre
Posted on: 09 Jul 2020 04:57

Hi Petar,

Thanks for your answer,

About your question we would say folding from A1 to first A2.

But our original problem (see attached .png) was a bit different, we have :

A1

B2

B1

B2

A2

Where the first B2 is obviously a syntax error as you mentionned. However the first region is folding from A1 to B2 which is not the corresponding closing tag and it's a bit confusing. 

We would expect it to close until the A2 tag (END). 

The syntax validation feature would also be a nice to have in this situation.

Best regards,

Pierre

 

 

ADMIN
Petar Mladenov
Posted on: 02 Jul 2020 13:20

Hi Pierre,

To be honest this is logged as a bug but is more like a not supported feature currently. For example in some well-known languages error will be shown in the IDE /Compiler if the structure of the language does not follow the rules. Our SyntaxEditor misses such error / (syntax) validation feature Currently I have a fix candidate code but I am not sure all clients will expect the behavior. For example: Open -close tag couples are A1-A2 and B1-B2. In the following structure:

A1
    B1
A2
A2

what do you expect - folding from A1 to first A2 or folding from A1 to second A2. I would appreciate your feedback on the matter. Also, probably property will be a good addition to the FoldingTaggerBase class to cover both scenarios. Having your input in mind, I will raise a discussion in my team and will let you know how we will proceed with this item. Thank you for your understanding.

Regards,
Petar Mladenov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Pierre
Posted on: 01 Jul 2020 10:08
Any update about this bug?