Been trying to find a way to make a file watcher to checks a file for changes, and runs of method. But every approach i tried sofar results in the UI of intellij just hanging.
This is what i tried last time
Im working with a toolwindow and a consoleView and am instantianting this FileWatcher object in my ToolWindow's activate field by passing in a Runnable that creates my object.
Im guessing there must be some native way to watch for file changes in intellij but not sure how to approach it.