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

Paths to headers get completed but everything else does not #15

Closed
alexpyzhianov opened this issue Jun 13, 2017 · 7 comments
Closed

Paths to headers get completed but everything else does not #15

alexpyzhianov opened this issue Jun 13, 2017 · 7 comments

Comments

@alexpyzhianov
Copy link

alexpyzhianov commented Jun 13, 2017

Hey!
I'm just starting out with C++ and making a small project with libcinder. I build it with cmake configuration that Cinder provides. Everything works fine but I can't make auto completion work.

What's interesting is that when I type #include "(...) a dropdown shows me a bunch of vaild options, including Cinder libs like:

#include "cinder/gl/gl.h"
#include "cinder/gl/Batch.h"

But when I try to see stuff in the included namespace typing something like gl::(...)... Nothing. I see only suggestions from buffer source.

My ./compile_commands.json looks like this:

[
{
  "directory": "/home/alex/projects/fixation",
  "command": "/usr/bin/c++  -DFT2_BUILD_LIBRARY -DFT_DEBUG_LEVEL_TRACE -D_GLFW_X11 -D_GLFW_GLX -D_GLFW_USE_OPENGL -D_GLIBCXX_USE_CXX11_ABI=0 -D_UNIX -isystem /home/alex/repos/Cinder/include  -g   -std=c++14 -o CMakeFiles/Fixation.dir/src/Fixation.cpp.o -c /home/alex/projects/fixation/src/Fixation.cpp",
  "file": "/home/alex/projects/fixation/src/Fixation.cpp"
}
]

After running cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 my project folder looks like this:

./Debug
./Debug/Fixation
./Makefile
./cmake_install.cmake
./structure.txt
./assets
./CMakeCache.txt
./compile_commands.json
./CMakeLists.txt
./CMakeFiles
./CMakeFiles/cmake.check_cache
./CMakeFiles/progress.marks
./CMakeFiles/CMakeTmp
./CMakeFiles/feature_tests.bin
./CMakeFiles/3.8.2
./CMakeFiles/3.8.2/CompilerIdC
./CMakeFiles/3.8.2/CompilerIdC/CMakeCCompilerId.c
./CMakeFiles/3.8.2/CompilerIdC/tmp
./CMakeFiles/3.8.2/CompilerIdC/a.out
./CMakeFiles/3.8.2/CMakeDetermineCompilerABI_CXX.bin
./CMakeFiles/3.8.2/CMakeCXXCompiler.cmake
./CMakeFiles/3.8.2/CMakeDetermineCompilerABI_C.bin
./CMakeFiles/3.8.2/CMakeSystem.cmake
./CMakeFiles/3.8.2/CMakeCCompiler.cmake
./CMakeFiles/3.8.2/CompilerIdCXX
./CMakeFiles/3.8.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
./CMakeFiles/3.8.2/CompilerIdCXX/tmp
./CMakeFiles/3.8.2/CompilerIdCXX/a.out
./CMakeFiles/Makefile.cmake
./CMakeFiles/feature_tests.c
./CMakeFiles/Fixation.dir
./CMakeFiles/Fixation.dir/progress.make
./CMakeFiles/Fixation.dir/build.make
./CMakeFiles/Fixation.dir/link.txt
./CMakeFiles/Fixation.dir/flags.make
./CMakeFiles/Fixation.dir/depend.make
./CMakeFiles/Fixation.dir/src
./CMakeFiles/Fixation.dir/cmake_clean.cmake
./CMakeFiles/Fixation.dir/DependInfo.cmake
./CMakeFiles/TargetDirectories.txt
./CMakeFiles/CMakeDirectoryInformation.cmake
./CMakeFiles/Makefile2
./CMakeFiles/feature_tests.cxx
./CMakeFiles/CMakeOutput.log
./src
./src/Fixation.cpp

Any help would be much appreciated. Thank you!

@alexpyzhianov
Copy link
Author

Quick update. Still not resolved, deoplete-clang picks my compile_commands.json but is very slow. My clang is 4.0.0 maybe major version has something to do with it

@tweekmonster
Copy link
Owner

This may be related to #14. If you don't think it is, I'm fairly clueless when it comes to C++, unfortunately.

@tweekmonster
Copy link
Owner

Actually I think I see the issue, but I don't really have any means to confirm it. Could you try adding this:

elif context.get('filetype', '') == 'cpp':
    pat += r'::'

below this line:

@alexpyzhianov
Copy link
Author

        if objc:
            pat += r'|[:@\[]|(?:\S\s+)'
        elif context.get('filetype', '') == 'cpp':
            pat += r'::'

Like this? Nope, nothing changed

@tweekmonster
Copy link
Owner

tweekmonster commented Jun 18, 2017

Sorry, the pattern is wrong. It should be pat += r'|::'

@alexpyzhianov
Copy link
Author

alexpyzhianov commented Jun 18, 2017

Wow! It works now! Thanks a lot!

@tweekmonster
Copy link
Owner

Great! I'll fix this shortly.

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