Posted 8 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar
Hi there,

I already got a semantic syntax highlighting up and running for C#. But since I have to do that in the GUI thread, my GUI tends to freeze.
I use a timer, so the semantic syntax highlighting is only performed when the semantic parse data hasn't changed in the last 500ms and no parse job is currently running.
But never the less the fact that the GUI freezes for that time span is a problem for me.
Is there a way to speed up the performance? I guess running in a separate thread is not an option, since the token collection could have been modified by then.

I am not sure, if I can post the code here, since some parts are similar to the way you build up the strings for your Intelli-Quick-Info.
The biggest problem is the call for CSharpContext.GetContextAtOffset() which takes more than half of the cpu time.


Best regards, Tobias Lingemann.

Comments (2)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Tobias,

We only call GetContextAtOffset once when a quick info tip is about to display. If you are repeatedly calling it during your examination for every identifier throughout the document, then that certainly could cause major slowdowns and would not be recommended. I'm really not sure what suggestion to offer if you are doing that.

In the newer WPF/Silverlight SyntaxEditor design, we have immutable snapshots in the documents. Those allow you to examine tokens on another thread, which would better support what you are trying to do here. We eventually hope to port that newer object model design back to the WinForms SyntaxEditor once it has all the feature areas covered that are in WinForms now.


Actipro Software Support

Posted 8 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar
That is exactly what I am doing. But I don't see another option either. I basically want a different syntax highlighting for identifier that are known types or methods (including those defined in assemblies). Implementing the logic on my own would not be worth the effort and I honestly doubt it would perform much faster.

So it looks like we have to cancel the feature for now.


Best regards, Tobias Lingemann.

The latest build of this product (v2020.1 build 0400) was released 24 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.