user10812902
user10812902

Reputation: 43

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

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?

Upvotes: 4

Views: 1361

Answers (1)

Feedforward
Feedforward

Reputation: 4879

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())

Upvotes: 3

Related Questions