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

Feature request: Automatically add paranthesis #60

Open
Toudahl opened this issue Apr 14, 2019 · 3 comments
Open

Feature request: Automatically add paranthesis #60

Toudahl opened this issue Apr 14, 2019 · 3 comments

Comments

@Toudahl
Copy link

Toudahl commented Apr 14, 2019

Would it be possible to have the extension automatically add parenthesis when appropriate?

The feature should place the cursor between the parathesis when there are arguments in the selected method/ctor, or one of its overloads.
It should place the cursor after after the closing parenthesis if there are no arguments.

@Dreamescaper
Copy link
Owner

That's not possible with current approach. Roslyn CompletionProvider API, which I'm using, allows to add new items, but I cannot change behavior of existing items.

Maybe that's possible using some other ways. Some kind of item commited event on VS side, where I could find symbol, and customize text. Not sure

@Toudahl
Copy link
Author

Toudahl commented Apr 22, 2019

Too bad.

Can you point me to some good resourses that might help me make this or add it to your extension?
I have been unable to find any quality information about VS extensions.

@Hurri04
Copy link

Hurri04 commented Jun 27, 2020

Does the API provide a callback to detect when an autocomplete suggestion has been accepted?
And if so, would it not be possible to check the type of the inserted symbol word to see if they need brackets (methods, constructors but not fields, properties) and then write brackets into the code?

I've installed this "TabAutoComplete" extension which adds brackets when pressing tab when the cursor is placed after a symbol word:
https://marketplace.visualstudio.com/items?itemName=RamonFMendes.TABAutoCall#overview
However, this is only a workaround because it requires pressing tab manually each time after auto-completing a method name.

Automatically inserting these brackets should be one of the most basic functions of an IDE. How Visual Studio of all things does not have this implemented as default behavior is beyond me.
There even is a ticket on the MS developer community page but all I ever see on that page is that issues get shuffled around between different devs who then add predefined texts every once in a while:

Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. We'll provide an update once the issue has been triaged by the product team.

So I have basically ZERO confidence that this will be addressed by MS anytime soon, if ever...

Edit:
The last comment on the MS Community page has a link to a closed duplicate which contains a link to an open github issue where MAYBE something is happening now (last activity 5 days ago), after the issue was opened 4 YEARS ago!!! 🙄

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

No branches or pull requests

3 participants