How do I add an event listener in an IntelliJ plugin?

user10812902 :

I am making an IntelliJ plugin and would like to add a RefactoringEventListener to it. I implemented the class, but the documentation is unclear on how I register it. Do I have to add it somewhere in plugin.xml?

Feedforward :

RefactoringEventListener has REFACTORING_EVENT_TOPIC topic, which is the entry point for the listener. You can use it like:

project.getMessageBus().connect(Disposable)
    .subscribe(RefactoringEventListener.REFACTORING_EVENT_TOPIC, new MyListener())

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=80998&siteId=1