Skip to content

xyc0562/auto-complete-clang

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

This is a completion source for the ``auto-complete`` bundle of Emacs. It act as an backend providing completion hints to auto-complete bundle by capturing Clang's output.

Install Prerequisite
====================

* auto-complete

auto-complete-clang act as a completion-source of auto-complete. So make sure you have installed auto-complete bundle for Emacs, and well configured it. For further information please refer to ``http://cx4a.org/software/auto-complete/``

* clang (>= 2.9 for C++ support)

Make sure clang is installed, since auto-complete-clang relies on Clang's ``code-completion-at`` parameter. 

You can get clang's svn trunk from here: ``http://clang.llvm.org/get_started.html#build``

Install and Configure
=====================

Put the ``auto-complete-clang.el`` file under the ``load-path``, so that Emacs will find it using ``(require 'auto-complete-clang)``. Since auto-complete-clang will invoke a clang process everytime a completion is triggered, you have to do some tweak for auto-complete. Please refer to the ``sample-config.el``.

A sample configure file for c-basic-mode is given, please refer to ``sample-config.el``.

Additional clang Options for source file and directory
=======================================

There are 2 ways to add additional clang options when doing completion:

1. Add "Magic comments" in source files in which clang auto-complete is supposed to run, for example:
    /* @clang:-iquote../include /*
2. Put options in a file located in source file's directory or several level of its parent directories (configurable, default is 3 levels). The default name is clangOptions. For example:
    If the source fie is in $DIR/src, then we might have $DIR/clangOptions with content:
    -iquote/xxx/xxx/xxx

If both clangOptions and "magic comments" exist, they will be concatenated and passed to clang. 

Comments:
==========

The option adding part is still very buggy and needs some love. Please feel free to help :)

Author
======

Mike Qin <mikeandmore@gmail.com>
Xu Yecheng <xyc0562@gmail.com>

About

clang completion source for auto-complete

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published