How to inspect build.grade


I'm trying to build a plugin for AndroidStudio that will inspect the dependencies in build.gradle file.
The results will be highlighted and shown message if mouse hover.
Like this one:
For *.java file I found that I can do inspect by extending "BaseJavaLocalInspectionTool" class.
However I could not find the alternative class for Gradle files...

Can someone point me in the right direction for this functionality ?

Thank you !

Comment actions Permalink

You can use org.jetbrains.plugins.groovy.codeInspection.GroovySuppressableInspectionTool (need to add groovy-plugin JARs to your IntelliJ Platform SDK).
Make sure to check current is actually a .gradle file to avoid inspecting .groovy files (see org.jetbrains.plugins.gradle.codeInspection.MultipleRepositoryUrlsInspection for sample)

Comment actions Permalink

Thank you very much !


Please sign in to leave a comment.