Delay automatic error squiggle lines

SyntaxEditor for WPF Forum

Posted 2 years ago by Josh
Version: 18.1.0


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 2 years ago by Actipro Software Support - Cleveland, OH, USA

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 (v24.1.2) 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.