Giter VIP home page Giter VIP logo

clangcomplete's People

Contributors

abuus avatar anderslanglands avatar berkus avatar eyenseo avatar pfultz2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clangcomplete's Issues

Mac?

Is there a path you recommend for using this on mac? I can't get it to work with my version of LLVM (doesn't recognize what a vector is of all things)

"default_include_paths" not working properly

I use GLib on a C project. And it seems that the option "default_include_paths" is not being read properly.

On the setting file: ClangComplete.sublime-settings" I've added:

"default_include_paths":
[
"/usr/include/c++/4.8/",
"/usr/include/x86_64-linux-gnu/c++/4.8/.",
"/usr/include/c++/4.8/backward/",
"/usr/lib/gcc/x86_64-linux-gnu/4.8/include/",
"/usr/local/include/",
"/usr/include/",
"/usr/include/glib-2.0/",
"/usr/lib/x86_64-linux-gnu/glib-2.0/include/",
"/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/",
"/usr/include/x86_64-linux-gnu/",
"/usr/include/"
]

But I keep getting error messages for headers not found:

"fatal error: 'glib.h' file not found"

glib.h is on: /usr/include/glib-2.0/glib.h

Am I missing something? Or is it a bug?

Thank you and kudus for this project!

Compilation error with g++ 4.8 / clang 3.4

I get the following error when trying to compile using g++ 4.8:

complete.cpp: In function ‘std::shared_ptr<async_translation_unit> get_tu(const char*, const char**, int, int)’:
complete.cpp:536:39: error: could not convert ‘lock.std::unique_lock<_Mutex>::lock<std::timed_mutex>()’ from ‘void’ to ‘std::shared_ptr<async_translation_unit>’
     if (timeout < 0) return lock.lock();
                                       ^
make: *** [all] Error 1

on commit 40e4bbb . This error does not occur with commit 8606a74.

ST3 crash on OSX

complete_at
error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted

Is there any recommendations how to debug such crashes?
I compiled ClangComplete on OSX with slight Makefile modifications, it is loaded but then immediately crashes plugin_host on first (or second) completion attempt.

Plugin does not work when no folder is open

When I open C++ file in sublime with no opened folders, plugin doesn't work and I see folowind log in console:
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 403, in on_post_text_command
callback.on_post_text_command(v, name, args)
File "/home/quasar/.config/sublime-text-3/Packages/ClangComplete/clangcomplete.py", line 492, in on_post_text_command
self.complete_at(view, "", pos, 0)
File "/home/quasar/.config/sublime-text-3/Packages/ClangComplete/clangcomplete.py", line 448, in complete_at
completions = convert_completions(get_completions(filename, get_args(view), row+1, col+1, "", timeout, get_unsaved_buffer(view)))
File "/home/quasar/.config/sublime-text-3/Packages/ClangComplete/clangcomplete.py", line 124, in get_args
project_path = get_project_path(view)
File "/home/quasar/.config/sublime-text-3/Packages/ClangComplete/clangcomplete.py", line 23, in get_project_path
return view.window().folders()[0]
IndexError: list index out of range

How to add files without cmake

quote the usage here:

"Also if cmake is not used, options can be manually set by setting the default_options setting."

Could you be more detail on how to let ClangComplete parse the files in my project without cmake?

Make display of error panel optional

Summary: Could you make the display of the error panel optional and default to ON?

I'm currently working on a project in which I mainly use ClangComplete for its completions, not the errors, as they are somewhat unreliable given that I'm compiling a miniature operating system for a university course.

Can't seem to get this to work

This isn't really an issue with the code - almost certainly on my end - but..

I cloned the repo into my Packages folder (~/.config/sublime-text-3/Packages/User/) and then went into ClangComplete/complete and ran make. Didn't get any errors, all seemed well.

I got a complete.o and libcomplete.so, which, after looking through the Makefile, looks to be what the targets were (doesn't align with what the Install section of the readme says..). So I open up ST3 and nothing happens. I tried the keyboard shortcuts with no result.

I then mv'd the ClangComplete directory up one so it's in ~/.config.sublime-text-3/Packages/ instead of being inside the User directory, but that didn't change anything.

What am I doing wrong?

Ubuntu 12.04

Has issues with Ubuntu 12.04. To get complete.cpp to compile clang-3.3, python-3.3, and gcc-4.8 have to be installed form ppa's. These ppa provide includes and libraries in different directories than the system ones. This proves to be a problem.

I was able to get complete.cpp to compile by altering the Makefile

-FLAGS=`pkg-config --cflags python-3.3`
+FLAGS=`pkg-config --cflags python-3.3` -I/usr/lib/llvm-3.3/include

However, nothing seems to be working within Sublime Text, not even any messages in the console.

Red hat based system - MakeFile

So, as always Red Hat based systems (fedora) always need a bit of special guidance when compiling.

This time I had to alter the makefile to set the clang_libs variable to -L/usr/lib64/llvm -lclang. It seems that the file libclang.so is located at /usr/lib64/llvm for a red hat based x64 system. And the clang_prefix was changed to /usr/lib/clang/3.4.2.

I'm not sure if it worth to add another condition to the makefile. But I though I should mention this if someone else is trying to use this awesome sublime package on their red hat system. Just saw #5 that fixes this issue completely

I have to note, I do get errors like /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/xmmintrin.h:213:10: error: use of undeclared identifier '__builtin_ia32_andps' but it continues parsing and giving the correct warnings and errors for the stuff that matters, so I'm not complaining.

First setup experience

Hello,

i started to use this plugin yesterday. I pretty much like the "autoconfigure" idea of it.

A few problems happend when i started to work with it.

  • flags.make was parsed a bit wrong, for C projects CFLAGS is the flag to look for not CXXFLAGS
  • compiler_commands.json parses the flags a bit wrong, it takes all flags except -g and stops if -o or -c was specified. Problem here is that the compiler flags do not need to follow a specific order, so after a -o/-c a -I can still happen, so a few flags are probebly lost
  • It would be super usefull if the error highlighting could be added, so errornous lines where underlined red.

(I addessed the first two issues in a PR)

Otherwise awesome plugin!

Compile error on OS X

Installed LLVM with

brew install --with-clang --with-all-targets --with-rtti --universal --jit llvm

but ld reports Undefined symbols error

g++ -std=gnu++0x -I/usr/local/opt/llvm/include/ -DNDEBUG -Os -c -fPIC complete.cpp -o complete.o
g++ -dynamiclib -Wl,-install_name,libcomplete.dylib -o libcomplete.dylib complete.o -L/usr/local/opt/llvm/lib/ -lclang
Undefined symbols for architecture x86_64:
  "std::out_of_range::~out_of_range()", referenced from:
      std::__1::unordered_map<unsigned int, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > >::at(unsigned int const&) in complete.o
      std::__1::unordered_map<unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >::at(unsigned int const&) in complete.o
  "std::terminate()", referenced from:
      ___clang_call_terminate in complete.o
  "typeinfo for std::out_of_range", referenced from:
      std::__1::unordered_map<unsigned int, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > >::at(unsigned int const&) in complete.o
      std::__1::unordered_map<unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >::at(unsigned int const&) in complete.o
  "vtable for std::out_of_range", referenced from:
      std::__1::unordered_map<unsigned int, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > >::at(unsigned int const&) in complete.o
      std::__1::unordered_map<unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >::at(unsigned int const&) in complete.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [all] Error 1

Using ClangComplete with Scons

Hi,

I read a comment that ClangComplete can work with any build system which generates compile_commands.json. I'm building with Scons, and have used Bear to create a compile_commands.json file.

Could you provide some instructions on how to proceed on the readme?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.