I've got a SyntaxLanguage with a C-style notation. In that language I've registered a CodeDocumentTaggerProvider on it.
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 7 years ago]