Cleanup of tagger

SyntaxEditor for WPF Forum

Posted 3 months ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Version: 19.1.0684
Avatar

Hi,

I have implemented a tagger for parse errors (based on CollectionTagger<ISquiggleTag>). I want the tagger to register an event handler, so he can refresh when some settings are changed. To remove the event handler I have overridden the method 'OnClosed', but this is never called.

I am curious since I never actually had to tell the editor to close, I just removed the control and that was it. And I didn't find any way to close the editor instance. How am I supposed to cleanup view based services like a tagger?

Alternatively I would have to refresh the tagger manually. How could I achieve that?


Best regards, Tobias Lingemann.

Comments (4)

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

Hi Tobias,

First, is the tagger created from a tagger provider service on your syntax language?


Actipro Software Support

Posted 3 months ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar

Yeah. I didn't even know there was another way :)

// this is called in the constructor of my SyntaxLanguage
RegisterService(new CodeDocumentTaggerProvider<MyParseErrorTagger>(typeof(MyParseErrorTagger)));


Best regards, Tobias Lingemann.

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

Hi Tobias,

What happens if you set the editor.Document.Language to SyntaxLanguage.PlainText when you want to "close" an editor?  That should initiate a sequence where taggers from languages are told to close.


Actipro Software Support

Posted 3 months ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar

Yes it does, but it seems a bit hacky. I guess I will use it as a temporary solution, but there should be a cleaner way.


Best regards, Tobias Lingemann.

The latest build of this product (v2020.1.0) was released 24 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.