Delay automatic error squiggle lines

SyntaxEditor for WPF Forum

Posted 8 months ago by Josh
Version: 18.1.0
Avatar

Hello,

We are using the automatic error squiggle lines and is working pretty good.  However, we notice the red squiggle lines appear too quick as the user is typing.  Is there a way to wait a bit until the user is somewhat done typing?

Comments (1)

Answer - Posted 8 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Josh,

I assume your squiggles are coming from parse errors generated by your syntax language's parser?  If so, the squiggles are generated by a ParseErrorTagger language service when the document.ParseDataChanged event fires.  You can't really delay that, at least the built-in functionality for it, but you could add a slight thread delay to your parser if it finishes too quickly.  That isn't an ideal thing though because other features like IntelliPrompt, generally benefit more from a quick parser.

The only other option would be to write your own ParseErrorTagger-like class instead of using ours and add some form of throttling into that.  The design summary of ParseErrorTagger is that it watches for the document.ParseDataChanged event, and when that fires, it updates all its tagged ranges by examining the document.ParseData to see if it implements IParseErrorProvider.  Then it scans through the errorProvider.Errors collection and converts each error's position range to an offset range (via the errorProvider.Snapshot), and creates an ISquiggleTag for the parse error, adding it to the tagger.


Actipro Software Support

The latest build of this product (v22.1.3) was released 20 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.