exclipy / clang_indexer Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
On x86_64 Gentoo I've got error from cmake:
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
Could NOT find LibClang (missing: LibClang_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLibClang.cmake:9 (find_package_handle_standard_args)
CMakeLists.txt:9 (find_package)
I have clang installed. Clang list of files:
root /> eq f clang
There's been a discussion at Issue 134 at Rip-Rip's clang_complete about what an editor-agnositc C++ indexer will look like. We need to flesh out those ideas and write it up in a wiki page so we can all agree on what we're building.
I managed to install /usr/local/BerkeleyDB.6.0/ with "configure --enable-cxx", install python binding of bsddb3.
And use hacking to redirect bsddb to bsddb3.
Finally, I still encounter problem in "clang_complete.vim":
NameError: name 'WarmupCache' is not defined
I commented out WarmupCache() in clang_complete.vim; now I can vim c/c++ files without warning. However, I still can NOT safely quit vim. VIM gets stuck, frozen, hangs. The only way to quit is to kill vim process.
My Env: FreeBSD 9.1-RELEASE (GENERIC) #0 r243825 amd64
My VIM version:
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr 9 2013 03:34:57)
Included patches: 1-121, 123-224, 226-234, 236-245, 248-251, 254-335, 337-385, 388-399, 401-433, 435-486, 488-490, 492-526, 528-568, 570-577, 582, 585-602, 604-610, 612-628
, 630-639, 641-649, 651-653, 661-669
Compiled by portbuild@9-49676
Big version with GTK2 GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv
+cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding
-footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +lua/dyn +menu +mksession
+modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_sysmouse +mouse_xterm +mouse_urxvt +mouse_sgr +multi_byte +multi_lang -mzscheme
+netbeans_intg +path_extra +perl +persistent_undo +postscript +printer -profile +python -python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white +tcl +terminfo +termresponse +textobjects +title +toolbar +user_commands
+vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/local/include/gtk-2.0 -I/usr/local/include/gio-unix-2.0/ -I/usr/local/include/atk-1.0 -I/usr/local/inc
lude/cairo -I/usr/local/include/pixman-1 -D_THREAD_SAFE -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/libpng15 -I/usr/local/include/pango-1.0 -D_REENTRANT -I/usr
/local/include/glib-2.0 -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include -O2 -pipe -fno-strict-aliasing -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
-I/usr/local/include/tcl8.5
Linking: cc -L/usr/local/lib -lXt -L. -L/usr/lib -rpath=/usr/lib:/usr/local/lib -pthread -rdynamic -Wl,-R/usr/local/lib/perl5/5.14.2/mach/CORE -L/usr/local/lib -Wl,--
as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes -lX11 -latk-1.0 -lcair
o -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lm -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -pthread -lglib-2.0 -lfreetype -L/usr/local/lib -lfontconfig -lSM -l
ICE -lXt -lXdmcp -lSM -lICE -lm -lelf -pthread -ltermlib -liconv -lintl -Wl,-R/usr/local/lib/perl5/5.14.2/mach/CORE -pthread -Wl,-E -fstack-protector -L/usr/loc
al/lib -L/usr/local/lib/perl5/5.14.2/mach/CORE -lperl -lm -lcrypt -lutil -L/usr/local/lib/python2.7/config -lpython2.7 -lutil -lm -Wl,--export-dynamic -L/usr/local/lib
-ltcl85 -lm -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby18 -lcrypt -lm -L/usr/lib -rpath=/usr/lib:/usr/local/lib -pthread -L/usr/local/lib
My "~/.vimrc" snippet:
let g:clang_auto_select=1
let g:clang_complete_auto=0
let g:clang_complete_copen=1
let g:clang_hl_errors=1
let g:clang_periodic_quickfix=0
let g:clang_snippets=1
let g:clang_snippets_engine="clang_complete"
let g:clang_conceal_snippets=1
let g:clang_exec="clang"
let g:clang_user_options=""
let g:clang_auto_user_options="path, .clang_complete"
let g:clang_use_library=1
let g:clang_library_path="/usr/lib/"
let g:clang_sort_algo="priority"
let g:clang_complete_macros=1
let g:clang_complete_patterns=0
nnoremap <Leader>q :call g:ClangUpdateQuickFix()<CR>
let g:clic_filename="../project-index/index.db"
nnoremap <Leader>r :call ClangGetReferences()<CR>
nnoremap <Leader>d :call ClangGetDeclarations()<CR>
nnoremap <Leader>s :call ClangGetSubclasses()<CR>
I'm currently using BerkeleyDB, but I'm not sure it's the best choice. I chose it because it's the most well-known and widely available simple key-value data store. But in the course of using it, I've found there's a lot of boilerplate code you need to write to use it, and it seems to be slow.
We need to do some performance testing to see if it really is a bottleneck, and to see if any alternatives are faster (LevelDB looks interesting).
I just installed the plugin and configured it.
If I try to get the references or subclasses for any of my types/methods I get an error
from the libclang.py:
Error detected while processing function ClangGetSubclasses:
line 2:
Traceback (most recent call last):
File "", line 1, in
File "/home/marius/.vim/bundle/clang_complete/plugin/libclang.py", line 355, in getCurrentReferences
usr = getCurrentUsr()
File "/home/marius/.vim/bundle/clang_complete/plugin/libclang.py", line 280, in getCurrentUsr
tu = getCurrentTranslationUnit(True)
TypeError: getCurrentTranslationUnit() takes at least 3 arguments (1 given)
line 3:
E121: Undefined variable: l:list
E116: Invalid arguments for function empty(l:list)
E15: Invalid expression: !empty(l:list)
Here follows my configuration related to clang_complete:
let g:clang_debug=1
let g:clang_user_options='|| exit 0'
let g:clang_auto_select=1
let g:clang_complete_auto=0
let g:clang_complete_copen=1
let g:clang_hl_errors=1
let g:clang_periodic_quickfix=0
let g:clang_snippets=1
let g:clang_snippets_engine="clang_complete"
let g:clang_conceal_snippets=1
let g:clang_exec="clang"
let g:clang_user_options=""
let g:clang_auto_user_options=".clang_complete"
let g:clang_use_library=1
let g:clang_library_path="/usr/local/lib"
let g:clang_sort_algo="priority"
let g:clang_complete_macros=1
let g:clang_complete_patterns=0
let mapleader = ","
nnoremap q :call g:ClangUpdateQuickFix()
" the path needs to be setup accrodingly
let g:clic_filename="/home/dev/index.db"
nnoremap r :call ClangGetReferences()
nnoremap d :call ClangGetDeclarations()
nnoremap s :call ClangGetSubclasses()
I use vim 7.3 with clang 3.1 built by me from sources.
It's clunky for the user to run clic_update.sh manually. The indexer should be an always-on process that watches the filesystem for updates and automatically updates the database.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.