How do i use FileWatcher in my extension to notify any changes to my extension?

I would like to use FileWatcher in my extension, where i would like to watch for any file changes and perform actions based on that in my extension.

[original thread by asvinwin123]

have you tried to study Theia code base? there should be plenty of examples

first what i found:

It watches workspace files by default

if you to watch files outside of a workspace, you have to call watch explicit and don’t forget to dispose a watcher when you are done.


thank you