Visual Studio 2013 Intellisense does not put enum

2019-06-22 18:04发布

问题:

For example, I have the following code:

namespace VS2013_EnumTypes
{
    class Program
    {
        enum SomeEnum
        {
            One,
            Two
        }
        static void SomeMethod(SomeEnum someEnum)
        {
            //some code
        }

        static void Main(string[] args)
        {
            SomeMethod()
        }
    }
}

In Visual Studio 2010 and 2012 I can type name of the method SomeMethod and when I type parenthesis '(' then Visual Studio 2010 and 2012 offers me to select the type SomeEnum. But Visual Studio 2013 doesn't do this. It only add for me closing parenthesis and doesn't offer me select enum type, and I am forced to type name of enum type manually.

How to force VS 2013 to show me enum type, which used as parameter of method?

回答1:

If you turn off Automatic Brace Completion (Tools->Options->Text Editor->C#) Visual Studio gives suggestions as in previous versions. Unfortunately that's just a bad workaround, but anyhow...

Hopefully this is not by design, and it might be related to this bug: http://connect.microsoft.com/VisualStudio/feedback/details/793192/vs-2013-autocompletion-of-parenthesis-breaks-intellisense.