Previously, it only debounced the postMessage. Now it debounces the entire operation to get the right selection context. I still see it called 2x for a cursor move (empty selection) and 4x for a non-empty selection due to VS Code calling the event handler multiple times for some reason, but this is a big improvement over before.
Previously, it only debounced the postMessage. Now it debounces the entire operation to get the right selection context. I still see it called 2x for a cursor move (empty selection) and 4x for a non-empty selection due to VS Code calling the event handler multiple times for some reason, but this is a big improvement over before.
Fixes https://linear.app/sourcegraph/issue/CODY-2481/debounce-or-throttle-commandscontextselection-file-calls-to-prevent
Test plan
Try selections and see how many OT spans get sent (and use logpoints).