-
Notifications
You must be signed in to change notification settings - Fork 263
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
Can't complete any C++ system headers and only some C system headers but jumping to their definition works #125
Comments
It is different. See my comment at #37 (comment) From your libstdc++Can you try this
Alternatively, set the initialization option
libc++See https://github.com/llvm-mirror/clang/tree/master/lib/Driver/ToolChains/Linux.cpp#L872 void Linux::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const {
const std::string& SysRoot = computeSysRoot();
const std::string LibCXXIncludePathCandidates[] = {
DetectLibcxxIncludePath(getDriver().ResourceDir + "/include/c++"),
DetectLibcxxIncludePath(getDriver().Dir + "/../include/c++"),
// If this is a development, non-installed, clang, libcxx will
// not be found at ../include/c++ but it likely to be found at
// one of the following two locations:
DetectLibcxxIncludePath(SysRoot + "/usr/local/include/c++"),
DetectLibcxxIncludePath(SysRoot + "/usr/include/c++") }; In a debug session, I find the 4
BTW, if you use clang 8, its |
Yes, I do have the libstdc++I've added the libc++Running
outputs:
|
@bfrg
Check the output of Adding You can find relevant |
The I have removed
The followings works (▎is the cursor position where I start the completion): #include <vector>
int main()
{
std::v▎
std::vector<int> v{1,2,3};
}
But when I start the completion below the vector instantiation: #include <vector>
int main()
{
std::vector<int> v{1,2,3};
std::v▎
}
Then, when I go back and try to complete above the line |
You may use strace/sysdig to dump LSP requests/responses #include <vector>
int main()
{
std::vector<int> v{1,2,3};
std::▎ // trigger textDocument/completion manually, is `vector` on the list?
} |
I've tried it with VS Code using your ccls extension and everything works fine. So it's definitively the language server client that I'm using (vim-lsp). Thank you for your help! |
I had gcc 12 installed but did not have libstdc++ for it. |
I'm on Gentoo Linux using
ccls
through vim-lsp. Further system info see below.Issues
ccls
doesn't find any C++ system headers and only a few C system headers:Completion of

std::vector
doesn't work:But completing a

std::vector
method or nested type works:Completing the methods of a

std::vector
instance works, too:Jumping to the definition of

std::vector
(or any of its methods) works, too:System info
This is how I built
ccls
:My system include directories (output of
clang -E -v -xc++ /dev/null
):This issue is similar to #37.
The text was updated successfully, but these errors were encountered: