Autocomplete Method Brackets

user3235057 picture user3235057 · Jan 30, 2014 · Viewed 18.4k times · Source

Using: Visual Studio Pro 2013

Previous research: [1], [2], [3]

I'm used to working in Java with Eclipse.

My usual flow is: object. CTRL+SPACE + ENTER which autocompletes the method and places the correct curly brackets & method inputs in there:

object.myMethod();
or
object.myMethod(input1,input2);

I'm trying to get the same behaviour with VS in C#. I can get the method, but it doesn't want to include the final brackets for some reason.

I get:

object.myMethod

Is there a way to enable this?

Answer

Murray picture Murray · Jan 30, 2020

When doing autocomplete, instead of just hitting ENTER, you can instead press the key combination "Shift + (" and it will autocomplete and add () all in the one.