How to trigger InspectionManager to start inspecting code in current open editors

Hi all,

I'm writing a plugin that also has its own codeInspection. The plugin calculates some stuff for the code inspection. When idea starts and there are some files open, the inspection manager will be triggered at some point. At this point my calculation might not have finished yet.

So, I would like to "force an update" to the inspection manager when my calculation is finished. Does anybody have an idea on how to do this (or a better suggestion)?

TIA,

Raymond Brandon

0
4 comments
Avatar
Permanently deleted user

Raymond Brandon wrote:

Hi all,

I'm writing a plugin that also has its own codeInspection. The plugin calculates some stuff for the code inspection. When idea starts and there are some files open, the inspection manager will be triggered at some point. At this point my calculation might not have finished yet.

So, I would like to "force an update" to the inspection manager when my calculation is finished. Does anybody have an idea on how to do this (or a better suggestion)?

TIA,

Raymond Brandon

There's no right way at the moment unfortunately. The hacky way is to modify something like any document or virtual file
or whatever. Analysis will be restarted automatically. For example you can create and delete some dummy java file under
source root anywhere.

--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

Does this dummy java file need to be open in one of the editors in order to trigger analysis or will the analysis also be triggered if the file is not currently open?

Thanks in advance,

Raymond Brandon

0
Avatar
Permanently deleted user

Raymond Brandon wrote:

Does this dummy java file need to be open in one of the editors in order to trigger analysis or will the analysis also be triggered if the file is not currently open?

Thanks in advance,

Raymond Brandon

No, not at all. Analysis restarts each time there's any change POTENTIALLY capable to modify the state of the analyzed file.

--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Hi

I also have a plugin that has some custom inspection.

In my plugin it is possible to change some behavior of this inspection in the settings menu.

Unfortunately the open files that where already inspected are not reinspected.

I need to close and reopen the files or to move the highlighing profile from inspection to syntax and then back again to inspection.

 

As this post is quite old, maybe there is a simple way of doing that now ?

Any help of how to proceed ?

 

Thanks in advance.

0

Please sign in to leave a comment.