Giter Site home page Giter Site logo

vim-clang's Introduction

vim-clang

Module to Interact with libclang (and clang_indexer DB) from Vim.

Project Stats

Features:

  • Inter-operates with clang_indexer DB
  • Displays the references of the C++ symbol under the cursor with <leader>r
  • Displays the declaration(s) of the C++ symbol under the cursor with <leader>d
  • Displays the Subclasses of the C++ symbol under the cursor with <leader>s
  • Encapsulates the updating of clang_indexer DB (which requires a project configuration compatible with BuildToolsWrappers format)

Installation Requirements:

Note: this module takes advantage of the following modules when they are installed:

With vim-addon-manager, just install vim-clang, and let VAM take care of installing all the vim dependencies. You'll still have to install Vim, Python, and clang_indexer by yourself.

Note: this script hasn't been registered yet to VAM addons list.

Options:

  • The options from clang_complete apply regarding libclang configuration ([bg]:clang_user_options that defines how to use libclang)

  • [bg]:_[{ft}_]_clic_filename that tells where clang_indexer database is located

  • g:clang_key_usr, g:clang_key_declarations, g:clang_key_references, and g:clang_key_subclasses, to override default choices to trigger vim-clang features.

To do list:

  • Interface ร  la taglist()
  • Reimplements features from lh-dev and lh-cpp#analysisLib*.

Disclaimer:

This module is a fork of @exclipy's fork of clang_complete. The functions dedicated to the interaction with clang_indexer have been extracted, and a few more will be added.

Licence:

getReferences() and getCurrentUser() functions are courtesy of exclipy.

Copyright 2013 Luc Hermitte

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

vim-clang's People

Contributors

luchermitte avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

vim-clang's Issues

Can't get vim-clang to work

Hello,

I found your fork of Rip-Rip/exclipy's clang_indexer on Rip-Rip's issues page, which interests me much because exclipy's clang_indexer isn't really working (I managed to get it to work after modifying some of the Py code but still it's nearly impossible to merge it with Rip-Rip's last updates, so I gave up).

However, after having installed all the dependencies including your plugins (lh-vim-lib and lh-dev) and vim-clang, I can't get it to work. I managed to find where it searches for the index.db (though this is not documented), that is in ./.clic/index.db, but even after creating manually the index.db I get this message when trying to get the references or declarations :

Searching for references to Display...
Error found processing function clang#display_references..clang#get_references :
ligne    3 :
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/corax/.vim/bundle/vim-clang/py/vimclang.py", line 146, in getCurrentReferences
    usr = getCurrentUsr()
  File "/home/corax/.vim/bundle/vim-clang/py/vimclang.py", line 50, in getCurrentUsr
    if ref is None or ref == Cursor.nullCursor():
AttributeError: type object 'Cursor' has no attribute 'nullCursor'

I'm a little fed up for today trying to debug Py code so I'm asking you for some help. By the way, is vim-clang currently really usable?

Thank you in advance.

PS: clang_complete works fine (I pulled the latest version from Rip-Rip)

PS2: when the index.db is not found, I should get a nice error but in fact I get a Py error complaining about exceptions:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/corax/.vim/bundle/vim-clang/py/vimclang.py", line 142, in getCurrentReferences
    clicDb = ClicDB()
  File "/home/corax/.vim/bundle/vim-clang/py/vimclang.py", line 75, in __init__
    raise "DBNoSuchFileError", filename
TypeError: exceptions must be old-style classes or derived from BaseException, not str
Error found processing function clang#display_references..clang#get_references :

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.