Dreamescaper / IntelliSenseExtender

GNU General Public License v3.0
88 stars 17 forks source link

Feature request: Automatically add paranthesis #60

Open Toudahl opened 5 years ago

Toudahl commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 4 years ago

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!!! 🙄