Removing ISquiggleTag with length 0 doesn't update the view

SyntaxEditor for WPF Forum

Posted 9 years ago by Roy Versteeg
Version: 14.2.0610
Platform: .NET 4.5
Environment: Windows 8 (64-bit)
Avatar

I've got a SyntaxLanguage with a C-style notation. In that language I've registered a CodeDocumentTaggerProvider on it.

RegisterService(new CodeDocumentTaggerProvider<ParseErrorTagger>(typeof(ParseErrorTagger)));

 When I start typing a function and I've got an missing closing } then I get a SquiggleTag past the end of the document. It displays as a Squiggle of lenght 1, but when I analyse the Tag from the Tagger I see that the length is 0.

I do some partial parsing of the document, and in the partial parsing I try to modify the Tag collection of the Tagger. But when I remove the zero length tag the view is not updated, and the Squiggle keeps displaying.

I've noticed a diffrence between Remove and Clear. When I Remove all tags, the zero length tags keep displaying, but when I call clear the view is Correctly updated.

So to summarize, after calling the following code the zero length tag is still visible, while not in the Tagger collection anymore

var taggerProvider = syntaxLanguage.GetService<CodeDocumentTaggerProvider<ParseErrorTagger>>();
var tagger = taggerProvider.GetTagger<ISquiggleTag>(document as CodeDocument) as CollectionTagger<ISquiggleTag>;

tagger.RemoveAll(x => true);

 

 When I replace the RemoveAll with a call to Clear it does get removed from the view.

I also got the same problem when adding a Tag myself with length 0 at the end of the document. It is not displayed.

How can I resolve this problem?

[Modified 9 years ago]

Comments (1)

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

Hi Roy,

My guess is that something with the zero-length range isn't propagating up to tell the appropriate view line to refresh.

Could you make a new simple sample project that shows the issue so that we can use it to debug the problem and ensure we get a code change in there that resolves it for you?  Please rename the .zip file extension of what you send so it doesn't get spam blocked and send the email to our support address.  Reference this thread in your email.  Thanks!


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.