Skip to content
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

Autocomplete should insert parenthesis for methods #1021

Closed
xeoneux opened this issue Dec 4, 2015 · 8 comments
Closed

Autocomplete should insert parenthesis for methods #1021

xeoneux opened this issue Dec 4, 2015 · 8 comments
Labels
feature-request Request for new features or functionality ux User experience issues
Milestone

Comments

@xeoneux
Copy link

xeoneux commented Dec 4, 2015

During autocompletion for methods, parenthesis do not get inserted automatically. Most of the time they are required and it's easier to delete them than insert them manually.

Eg: Tab or Return after var arr = str.sp should autocomplete to var arr = str.splice() rather than var arr = str.splice with the cursor between the parenthesis.

@Tyriar
Copy link
Member

Tyriar commented Dec 4, 2015

Not sure I agree with this as the default behavior, in JS and more functional languages in particular it is quite common to use functions as references such as passing them in as arguments. Something like this could irritate developers when they're used to typing () anyhow. An example of where this would get annoying:

var func = function (a, b) { /*...*/ }
if (func) {
  someFunction(func);
  someOtherFunction(func.bind(null, x, y));
}

Do you know any editors/IDEs that use this as the default?

@xeoneux
Copy link
Author

xeoneux commented Dec 4, 2015

Calling methods is common than passing them as arguments. Many IDEs like WebStorm, IntelliJ Idea and Android Studio use this as default behaviour and it really helps in coding faster.

I understand that this could irritate developers who are accustomed to typing parenthesis but for other developers who come from the JetBrains world, it becomes an extra effort. A simple option to enable this behaviour in settings would really help.

@egamma egamma added feature-request Request for new features or functionality ux User experience issues labels Dec 8, 2015
@egamma egamma modified the milestone: Backlog Dec 10, 2015
@xeoneux
Copy link
Author

xeoneux commented Jan 14, 2016

After using Cloud9 IDE online and then switching to Visual Studio Code for offline work makes you realise the importance of this feature. Will it be available in the future?

@tinganho
Copy link

Totally agree on @xeoneux 👍 . If one just wants the identifier, it is just one backspace away. I have been quite annoyed by this also. It seems like the autocomplete suggests me a variable and not a function or method.

@egamma
Copy link
Member

egamma commented Jan 15, 2016

We have experimented with different options in the past. Currently we defer it to the language service.
CC @jrieken.

@jrieken
Copy link
Member

jrieken commented Jan 15, 2016

for TypeScript this should still be supported with the useCodeSnippetsOnMethodSuggest setting

@xeoneux
Copy link
Author

xeoneux commented Jan 29, 2016

useCodeSnippetsOnMethodSuggest option for JS and TS works beautifully! I wonder why it isn't enabled by default. Thanks @jrieken 👍

@xeoneux xeoneux closed this as completed Jan 29, 2016
@neooleg
Copy link

neooleg commented Sep 6, 2017

For C# there is open issue for now dotnet/roslyn#12363

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality ux User experience issues
Projects
None yet
Development

No branches or pull requests

6 participants