bradfeehan / SublimePHPCoverage

A plugin for Sublime Text 2 and 3, which visualises PHP code coverage data in the editor.
MIT License
57 stars 10 forks source link

Watch the code coverage file for changes and update the editor #3

Closed bradfeehan closed 11 years ago

bradfeehan commented 12 years ago

Using inotify or something similar, watch the code coverage XML file for any changes, and automatically update the content of any open PHP files.

bradfeehan commented 11 years ago

Working on a solution to this which involves polling (bummer, but the only reliable cross-platform way).

brodkin commented 11 years ago

@bradfeehan Is there any way to support multiple watch methods depending on the filesystem and os?

bradfeehan commented 11 years ago

Sure, in theory, but it's quite a pain. I tried integrating watchdog, but it uses some C libraries which would need to be compiled for the target machine, and would require a Python egg for each OS. And then it falls back to polling, if there's nothing better available.

The polling solution is quite acceptable performance-wise, in practice it's just doing a stat() on most likely a single file (the coverage file) every 100ms, and that data will be cached by the OS in most cases... I don't think it's worth it.

brodkin commented 11 years ago

@bradfeehan That's fair.