Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a function's namespace #39

Closed
Davidbrcz opened this issue Apr 8, 2019 · 1 comment
Closed

Find a function's namespace #39

Davidbrcz opened this issue Apr 8, 2019 · 1 comment

Comments

@Davidbrcz
Copy link

Hi,

Is there a way to find the namespace in which a function belong ?

For instance:

//C.h
namespace A{namespace B
struct C{void foo();};
}}
//C.cpp
#include "C.h"
using namespace A::B;
void C::foo(){
// cursor is here,
}

With the example above, the namespace command would display A::B (because foo is defined in C, which is in namespace A::B.

Is there a way to it ?

Thanks !
David

@MaskRay
Copy link
Member

MaskRay commented Apr 8, 2019

textDocument/hover displays that.

The ccls extension $ccls/navigate may be handful. https://github.com/MaskRay/ccls/wiki/lsp-mode#ccls-navigate

(ccls-navigate "D") ;; roughly sp-down-sexp
(ccls-navigate "L")
(ccls-navigate "R")
(ccls-navigate "U")

@MaskRay MaskRay closed this as completed Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants