microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

NavigateToSymbol dialog flitters when typing suggestions #241

Open DanielRosenwasser opened 9 years ago

DanielRosenwasser commented 9 years ago

When typing navigate-to suggestions on a Mac, I get a choppy experience as the menu keeps disappearing and reappearing. Not sure if this repros on Windows.

zhengbli commented 9 years ago

This is known with large files, as it does a new search with every key stroke. Maybe change the behavior to async somehow could help. How large is the file (project) that you are working on?

DanielRosenwasser commented 9 years ago

How large file (project) are you working on?

Just working on the TypeScript compiler (i.e. src/compiler/). We can discuss it whenever I get back in. Is there another issue tracking this, or should this be marked as a bug?

DanielRosenwasser commented 9 years ago

Actually, this is pretty bad; if I work on src/services, it's not that difficult for me to accidentally start entering text in the buffer as a result of this.

Perhaps we could try throttling requests; @CyrusNajmabadi might have an idea of whether or not in VS we fire off a NavigateTo request immediately after every keystroke in the search box, but if we waited a small interval after every keystroke or after a certain number of keystrokes, we could potentially improve the experience.

steveluc commented 9 years ago

We used to limit the number of responses to 50, to wait until at least two characters are typed and to also delay 30ms before sending a request. With these parameters src/compiler and src/services were working well.

DanielRosenwasser commented 9 years ago

@steveluc is there any reason we diverted from this behavior?