Closed dilomo closed 3 years ago
You're right in suggesting this code monstrosity should not exist!
The heart of this problem is that many editors don't send one event, but send many events.
Visual Studio:
Visual Studio Code:
In the master branch I've deleted this code monstrosity with the class ScriptFileWatcher(). This code waits for 300ms after each event to wait if there is a new event coming (Debounce), and once new events are no longer coming, only one event is thrown.
Does this also work for you?
That's fine with me but is 300ms not too long? I have no idea.
I've updated it to 100ms, should be more than enough for all the slow hard drives out there.
I'm wondering if we need that code anymore to slow down the plugin waiting:
I did a few tests and it seems to work ok but not sure what was your intention on cleaning up t so better consult with you