microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.53k stars 1.56k forks source link

Intellisense is abnormal while coding c++, typing something under a line comment in a namespace #8735

Closed BH2WFR closed 2 years ago

BH2WFR commented 2 years ago

Bug type: Language Service

Describe the bug

Description of Problem like this gif, I found a problem while coding c++, the intellisense is abnormally working while I type something in a namespace with the other namespace with a same name before it.

If I remove the line comment, it works normally, but when I add any comment, it works abnormally, and can't give me items in the privious namespace with the same name.

Also, if this problem occers, enumerations defined front also can't be recognized when I type its name.

I resently asked it in StackOverFlow and a comment says that It might be a bug of the extension... so may I know if it is a real bug or just I had typo on my code ...

Here is the GIF screen record of my problem...

Problem Code

namespace Gunseban{
    int asdf = 1234;      // **elements inside the namespace, I want the intellisense to recognize these**

    class shsh{
        public:
        int c = 20;

    };  
    namespace MYTEST{
        int dgm = 300;
    }
}
// two namespaces with same name
namespace Gunseban{
    //==== **This comment cause the problem, If I add this, Intellisense can't recognize the items defined in the previous namespace**
    int bb = 30;    // **this comment also cause the problem**

    class MyProblem{
      public:
        int cc = 90;

    };
}
sean-mcmanus commented 2 years ago

I'm not able to repro the bug. The extension "C++ intellisense" provides conflicting functionality so it might be caused by that extension. Can you disable that and try again?

Are you able to repro the problem with the gcc, clang, or cl compilers?

github-actions[bot] commented 2 years ago

This issue has been closed automatically because it needs more information and has not had recent activity.