Skip to content

Nonword characters should trigger autocomplete #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rigdern opened this issue May 5, 2015 · 4 comments
Open

Nonword characters should trigger autocomplete #183

rigdern opened this issue May 5, 2015 · 4 comments

Comments

@rigdern
Copy link

rigdern commented May 5, 2015

Users shouldn't be required to hit tab/enter to autocomplete. Text should be autocompleted when you hit a nonword character (e.g. ".", "<>", "[]", "{}", "()"). For example, typing “document.bo” followed by a period should autocomplete to “document.body”.

Visual Studio supports this for C#. In VS, you can get this feature by unchecking the “Only use tab or enter to commit” checkbox in the intellisense options. It would be great to also have this functionality for TypeScript in Sublime.

@danquirk
Copy link
Member

danquirk commented May 6, 2015

Note VS supports this for TypeScript in VS2015.

@rigdern
Copy link
Author

rigdern commented May 6, 2015

It looks like this is currently broken in VS for TypeScript: microsoft/TypeScript#315

@danquirk
Copy link
Member

danquirk commented May 6, 2015

The completion behavior you want is fixed in VS in microsoft/TypeScript#2482, the issue you referenced is just tracking the lack of an option to configure what characters cause the completion results to be committed.

@billti
Copy link
Member

billti commented May 6, 2015

I'm not convinced this is the right behavior to add. As a general principle, we're trying to make our Sublime plug-in behave in a manner that will be very familiar to Sublime users, not try and recreate the Visual Studio experience. I'm not aware of any other Sublime plugins that provide this behavior (and the native behavior doesn't).

Beyond if we should do it, is if we can do it. I'm not sure the Sublime API is rich enough here. For example, we'd need to know when the completion list is no longer present in order not to then auto-complete on a character. Sublime has commands you can detect for when it is explicitly dismissed (hide_auto_complete), however there are a number of scenarios where it is implicitly dismissed that don't have notifications and are non-trivial to get right (e.g. moving the cursor, typing chars that cause no matches in the filtered list, etc...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants