dotnet/roslyn

C# intellisense suggestions missing class name in nested types

Aperta

#51.699 aperta il 5 mar 2021

 (1 commento) (0 reazioni) (1 assegnatario)C# (4257 fork)batch import
Area-IDEBugIDE-IntelliSensehelp wanted

Metriche repository

Star
 (20.414 stelle)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice] Microsoft Visual Studio Community 2019 Version 16.9.0

Steps to reproduce the problem:

  1. Create a new C# (console) project (.NET 5.0).
  2. Enter the following codes:
namespace IntellisenseBug
{
    public class ClassA
    {
        public static void MethodA()
        { }
    }

    public class ClassB
    {
        public ClassA ClassA { get; set; }

        public void MethodB()
        {
            //ClassA.MethodA();
        }

        public class ClassC
        {
            public void MethodC()
            {
                //ClassA.MethodA();
            }
        }
    }
}

  1. Try to type ClassA.MethodA(); in public void MethodB() by hand. Intellisense works as expected: 屏幕截图(863).png 屏幕截图(864).png
  2. However, when typing ClassA.MethodA(); in public void MethodC() by hand, Intellisense does not work as expected: 屏幕截图(865).png ClassA is missing in the Intellisense suggestions.

Original Comments

Feedback Bot on 3/3/2021, 06:15 PM:


Original Solutions

(no solutions)

Guida contributor