Improve updates of outlining nodes

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Version: 12.1.0288
Platform: .NET 4.0
Environment: Windows 7 (64-bit)
Avatar

Hello,

I have encountered some problemes using the outlining features.
The outlining nodes sometimes get updated incorrectly.
In most cases the the outlining node covers a function in my code like this:

MyFunc()
{
}

If I select "MyFunc" and start replacing the text to for example "Foo", the outlining node starts with the opening parenthesis.

In my opinion this is a bug. The same thing happens, if I insert text directly in front of "MyFunc". The update should consider, that the outlining node has been extended and not moved. If I would insert a whitespace it would be moved.


Best regards, Tobias Lingemann.

Comments (4)

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

Hi Tobias,

It's hard to say what's going on without seeing it happen and being able to debug it.  If you'd like us to take a look, please make a new simple sample project that shows the issue e-mail it to our support address, referencing this post.  Rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 12 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar

Well I currently don't have the time for a sample project, but the key facts are, that the outlining node covers the whole function, not only the body. So the first offset is the 'M' in "MyFunc".
The outlining node does not start with the '{' because we want the expand/collapse button to be in the same line as the header.

The second thing is, that I cannot update each outlining node whenever I get new parse data. This is just way to slow. We have to deal with generated code in our editor that has more than 300k LOC in a single file (~18MB). So I only delete the outlining node if they have been removed completely.

I think I could workaround the issue, if I delete the whole node as soon as the first offset is deleted, but I figured your update mechanismn should cover those operations (or at least the replace operation).


Best regards, Tobias Lingemann.

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

Hi Tobias,

I'm not sure how you are doing outlining, if it's manual or automatic.  But if it's more manual, it sounds like there might not be anything we can do here since in the scenario you mentioned, typing to replace MyFunc will cause our incremental update logic for the outlining tree to move the outlining node's start offset to the next character, which is the '(' and then the "Foo" that is typed is effectively inserted prior to that node.  The node doesn't expand to include it.  That is intended by design.  It's really up to whatever is creating the nodes to know and alter the node such that it would cover the "Foo".  With automatic outlining, we do the same incremental update logic and then the automatic outlining which comes in later (generally from work done on a worker thread from parsing) on will tweak things as needed, by sliding the outlining node's start back to cover "Foo".


Actipro Software Support

Posted 12 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar

Okay. Maybe I can tweak the update scenario. I get all the correct offset from my compiler, but I only add or remove nodes, because I figured the automatic updates cover most cases. Plus updating outlining can get extremely slow for 20k nodes.


Best regards, Tobias Lingemann.

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.