wait for DaemonCodeAnalyzer to complete pass on file Follow
Answered
Morning...
I'm using DaemonCodeAnalyzerEx to retrieve the linting information from the editor, such as deprecations, unused imports and so on.
I am setting text in the current document in the editor, and what I don't know is how to wait for the linting pass to complete before attempting to retrieve the linting info. I have tried various refresh methods, DaemonCodeAnalyzer.restart(), etc etc, but nothing is working for me.
I also tried subscribing to DaemonCodeAnalyzer.DAEMON_EVENT_TOPIC but it appears to never fire com.intellij.codeInsight.daemon.DaemonCodeAnalyzer.DaemonListenerAdapter#daemonFinished.
I'm quite new to this whole thing so quite likely a noob fail, so any help appreciated.
cheers, jamie
Please sign in to leave a comment.
Thanks for that Alexey. I had connected to the app message bus with the same topic... it works for projects. I don't suppose there is a way to get the file that it's just finished on?
no, unfortunately. However, the current opened (if any) editor can be obtained via com.intellij.openapi.fileEditor.FileEditorManager#getSelectedTextEditor
Sure... ok, thanks for your help.