How to listen to Gradle build file (Kotlin or Groovy) changes? Follow
Answered
Hello,
I need to listen to Gradle build file changes in order to automatically launch an action.
Is there an easy way to do that?
Thanks for help
Regards
Please sign in to leave a comment.
I found the solution implementing "DocumentListener" on the PSI file but it triggers event on live change.
I would like to be warned on property change only after file is saved. Any idea?
There's dedicated EP com.intellij.ide.actionsOnSave.impl.ActionsOnSaveFileDocumentManagerListener.ActionOnSave
Thanks a lot Yann, I'll have a look to this EP
For now I work with 'PsiTreeChangeListener / Adapter' but it's the same behavior (live notification when a child is replaced which is pretty good to be sure the right parameter is updated, but not useful for the user since He cannot finish to update the parameter value without being interrupted with a notification)
I'm facing an issue with the ActionOnSave EP.
Should I extends "com.intellij.ide.actionsOnSave.impl.ActionsOnSaveFileDocumentManagerListener"? ("actionsOnSave" seems not known -> error on import)
Or Should I only implements FileDocumentManagerListener?
FileDocumentManagerListener only manage before saving operations (not after saving).
Finally, "com.intellij.openapi.fileEditor.FileDocumentManagerListener.beforeDocumentSaving" API is suiting me (fileDocumentManagerListener EP).