codemaid
codemaid copied to clipboard
Spade cannot recognize code elements under namespace
Environment
- Visual Studio version: 2015 enterprise
- CodeMaid version: 10.5
- Code language: C++
Description

CodeModelBuilder.cs line 128 codeElement.Children is Empty when codeElement.Kind is vsCMElementNamespace
Thanks for reporting the issue and looking into it. If the API is not able to provide the elements, it makes sense that they would not be available.
It seems that the problem only occurs in the cpp file. The corresponding header file is normal, but the CodeElement(StartLine EndLine and other information) from header file seems come from the cpp file. This is weird.
Yeah, unfortunately the older EnvDTE APIs have never been super consistent.. more so for C++ than other languages like C# and VB. Also unfortunately, I haven't heard any plans about C++ moving on to the newer Roslyn APIs/pipeline.
Confirming that this is still a bug in Visual Studio 2022, Codemain version 12.0. Removing the namespace from my class makes the methods show up in Spade that are within the .cpp class. This really limits the usefulness as almost all of the C++ code that I work with is within namespaces.