vscode-code-outline icon indicating copy to clipboard operation
vscode-code-outline copied to clipboard

[C++] Symbols not shown for class implementations

Open mbahri opened this issue 8 years ago • 2 comments

Hi,

First of all, thank you for providing this plugin! It really fills a gap.

There is an issue with C++ code. Consider the below minimal working example:

// Header file: myfile.h
#ifndef __myfile__
#define __myfile__

class Example {
    public:
        void sayHello();
};

#endif

And the implementation

// File myotherfile.cc
#include "myfile.h"
#include <iostream>

void Example::sayHello() {
    std::cout << "Hello" << std::endl;
}

int main()  {
    Example ex;
    ex.sayHello();
    
    return 0;
}

Code Outline will correctly detect the symbols for the class "Example" and its method "sayHello()" when editing "myfile.h" but will only find "main()" in "myotherfile.cc".

It would be handy to have Example::sayHello() in the tree for "myotherfile.cc", VS Code's symbol navigator (Ctrl+Shift+O) correctly detects them.

Many thanks!

mbahri avatar Jun 14 '17 14:06 mbahri

fwiw, this is probably fixed by https://github.com/patrys/vscode-code-outline/pull/27 (at least, it works using cquery for C++ after that PR)

jacobdufault avatar Jul 14 '17 05:07 jacobdufault

@mbahri Can we close this now?

patrys avatar Oct 25 '17 21:10 patrys