I am creating a VS extension and I need to get code elements for the current document. Given this cpp file:
#include "C.h"
namespace N
{
void C::f()
{
}
}
the VCFileCodeModel contains the include statement and the namespace, but the namespace does not have any children/members. However, if I insert a non-member function into the namespace, or remove the namespace, the code model will be correct. With the
problematic case, I have tried to add the same function C::f() to the namespace using VCCodeNamespace object and it succeeds, however after that it still has 0 children/members. Is this a bug or am I missing something? Thanks.