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: https://github.com/theia-ide/theia/blob/64b0b02e1e673108f829f8e0ea913fbc00f29739/packages/markers/src/browser/marker-manager.ts#L118-L128

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.

[asvinwin123]

thank you