microsoft / TypeScript-Sublime-Plugin

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

prevent interruption to tab based autocompletion #733

Closed matthandlersux closed 4 years ago

matthandlersux commented 4 years ago

this PR is a small change that fixes an issue with the expected behavior of sublime text after installing this plugin.

currently, with the plugin installed, when you type a word fragment and then press tab, if typescript does not have any suggestions for autocomplete, then sublime will insert a literal tab/spaces. without the plugin, however, sublime would allow you to tab through several autocomplete suggested words (pulled from matching words in the current document).

the flag that this PR removes (described here), makes it so that sublime's standard list of words offered up as part of tab completion are not wiped out. essentially, this restores the expected behavior of typing a word fragment and then hitting tab within sublime.

if the reviewers would like, i'd be happy to make this part of the plugin config; it is unclear to me if this flag was set deliberately or not.

interestingly, i think other people previously were trying to raise this same issue, but there was some confusion because of the ambiguity of the phrase "autocomplete does not work". that could mean "when i press tab, the thing i'm used to sublime doing no longer happens", or it could mean "when i try to use autocomplete from this plugin, no results are suggested by tsserver". here are a few where i think this may have been the case: https://github.com/microsoft/TypeScript-Sublime-Plugin/pull/445, https://github.com/microsoft/TypeScript-Sublime-Plugin/issues/442, https://github.com/microsoft/TypeScript-Sublime-Plugin/issues/512

orta commented 4 years ago

Perfect, thanks for the write-up, so it looks like this is the before:

Screen Recording 2020-01-15 at 11 42 22 AM 2020-01-15 11_43_18

and after:

Screen Recording 2020-01-15 at 11 41 42 AM 2020-01-15 11_44_07

I can see that is a better experience, let's get this in.