problem with SemanticParserService.WaitForParse

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by Nick
Version: 4.0.0234
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
Hi,

Before preparing a MemberList, I'm trying to call SemanticParserService.WaitForParse in order to consider the most recent code changes.
Unfortuantly, this call always blockes the application for the duation of the timeout.
Moreover, the semantic parser only kicks-in after WaitForParse returns.

I found this technique in your sample application in the file SimpleSyntaxLanguage.cs:

...

    private bool ShowIntelliPromptMemberList(SyntaxEditor syntaxEditor, bool completeWord) {
        // Try and ensure the compilation unit is up-to-date
        SemanticParserService.WaitForParse(SemanticParserServiceRequest.GetParseHashKey(syntaxEditor.Document, syntaxEditor.Document), 5000);

...

In your sample code, you use the version of WaitForParse which uses a built-in 250ms timeout, so it's hard to notice that it's blocking, but if you change it to some significant timeout (say 5000ms) you can see it clearly.

Note that it is only blocking when there is actually a pending parsing request (so, in your sample app, you need to type something and then immedialy press Ctrl-Space), otherwise it returns immediately.

Thanks in advance

Comments (3)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Wow, this was a gem of a find Nick. You are correct, there was a blocking call when the parse completed and was updating the Document's semantic parse data, thereby making it us the full wait time since both threads were suspended at that point.

This is now fixed for the next maintenance release. And the great thing is that this will really speed up the built-in IntelliPrompt for the .NET Languages Add-on since we use WaitForParse as well and it was waiting 250ms anything we did some IntelliPrompt context retrieval.


Actipro Software Support

Posted 17 years ago by Nick
Avatar
Cool!

I'll be waiting for that maintenance release.
How will I know when it's released ?

Regards
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We will probably try and get a new build out shortly in the next several days if possible. The best way to know when releases occur is to subscribe to the RSS feed for our Announcements forum. If you don't do RSS subscriptions, then you can also just visit that forum or look at other places on our site to see the current build number and when it was released. I believe our home page also lists the latest build numbers.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.