Wikia

Vim Tips Wiki

Changes: Script:3302

Edit

Back to page

(Change <tt> to <code>, perhaps also minor tweak.)
(Added note about mapping overriding.)
Line 32: Line 32:
 
Hi,
 
Hi,
 
Does anyone know how to get list of overloaded functions when we use clang_complete? I can only see one of the overloaded functions in the autocomplete popup window.
 
Does anyone know how to get list of overloaded functions when we use clang_complete? I can only see one of the overloaded functions in the autocomplete popup window.
  +
  +
==Newline Mapping==
  +
If you have <CR> bound to anything this plugin will override that.

Revision as of 04:10, January 18, 2014

Use this page to discuss script 3302 clang complete: completion of C, C++, Objective-C and Objective-C++ using Clang

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Notes on .clang_complete

The compiler switches in .clang_complete are not the same as on the command-line. For a fresh test-project I am able to compile my file via clang++ main.cpp -c -v but a plenty of more details need to be put into .clang_complete (in my case).

The best way - in my opinion - to create a .clang_complete file is to make your file/projekt compile on the command line and then enable verbose output via '-v':

my@suse:~/home/my/test> clang++ main.cpp -c -v -fno-color-diagnostics -fdiagnostics-format=vi
clang version 3.0 (tags/RELEASE_30/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
/home/my/src/llvm/build_3.0/Release/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name main.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 11.2 -momit-leaf-frame-pointer -v -coverage-file main.o -resource-dir /home/my/src/llvm/build_3.0/Release/bin/../lib/clang/3.0 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/4.4/../../../../include/c++/4.4 -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/4.4/../../../../include/c++/4.4/x86_64-suse-linux -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/4.4/../../../../include/c++/4.4/backward -internal-isystem /usr/local/include -internal-isystem /home/my/src/llvm/build_3.0/Release/bin/../lib/clang/3.0/include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fmessage-length 213 -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fdiagnostics-format vi -o main.o -x c++ main.cpp
... (further outputs) ...

The contents that are marked bold should be put into .clang_complete. The paths - of course - should be prepended by -I. So the resulting .clang_complete file will look like this:

-I /usr/include/c++/4.4 -I /usr/include/c++/4.4/x86_64-suse-linux -I /usr/include/c++/4.4/backward -I /usr/local/include -I /home/my/src/llvm/build_3.0/Release/lib/clang/3.0/include -I /usr/include -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fdiagnostics-format vi

Comments

Couldn't the clang parser also be used to improve the taglist plugin? script#273

I thinks tab taglist is a great tool. However, it has problems with advanced C++ code. --Michael.lehn 17 November 2011

Have you tried Tagbar? It specifically aims for better C++ support that Taglist, but is similar in many ways. --Fritzophrenic 15:23, November 21, 2011 (UTC)

--

Hi, Does anyone know how to get list of overloaded functions when we use clang_complete? I can only see one of the overloaded functions in the autocomplete popup window.

Newline Mapping

If you have <CR> bound to anything this plugin will override that.

Around Wikia's network

Random Wiki