gedit clang plugin progress

A quick update on the gedit clang integration. Here is a screenshot of the latest visualization of errors in source code:

gedit clang plugin

You can checkout the code on github for now: https://github.com/jessevdk/gedit-code-assistance. If you want to try it out, install the gedit-devel (>= 3), llvm and llvm-devel (>= 2.8) packages and compile the plugin (see the README for more information).

Posted in gedit. 12 Comments »

12 Responses to “gedit clang plugin progress”

  1. Renke Grunwald Says:

    Wow, this is really impressive :)

  2. Marcus Lundblad Says:

    Nice!

    Any chance of this being ported to Anjuta?

    //Marcus

  3. Sam Says:

    This is awesome. Thanks for the time and effort you put into improving gedit and working on awesome plugins like this and gedit-collaboration.

  4. Bob Bobson Says:

    How do you know what command line arguments the compiler will be called with. For example, in this code, printf could be redefined on the command line to be a macro that refers to some other function that is in scope.

    Slightly contrived example I know, but in reality most software has those sort of weird things in them. Surely you’ll always be giving duff errors messages.

  5. Jesse van den Kieboom Says:

    @bob: yes of course. At the moment the plugin will use makefile infrastructure to deduce the command line arguments. It will basicly look at all your make rules, find out which targets have the file to be parsed as a dependency and then extract the compiler flags from simulating an execution of that target. This is not completely fool proof of course, but works actually fairly well with the projects that I tried it on. There will also be the possibility to specify compile flags manually.

    In the future we might integrate this with a project manager plugin that is also being developed.

  6. Jordy Dickinson Says:

    Will this work with other languages clang supports, like C++ and Objective-C?

  7. Jesse van den Kieboom Says:

    @jordy: indeed

  8. Nadav Vinik Says:

    Wow, It’s work great thanks!!!

    clang lib is missing in debian/ubuntu so I just:
    wget http://llvm.org/releases/2.9/clang+llvm-2.9-i686-linux.tgz
    tar -xzf clang+llvm-2.9-i686-linux.tgz
    mv clang+llvm-2.9-i686-linux usr
    tar czf clang+llvm-2.9-i686-linux.tar.gz usr
    fakeroot alien -d clang+llvm-2.9-i686-linux.tar.gz
    sudo dpkg -i llvm_2.9-2_all.deb

    Work great!
    (Although apply the patches in the pull request to make it compile)

  9. jessevdk » gedit code assistance plugin Says:

    [...] a quick update on the gedit code assistance plugin (see this previous post). We moved development from github to gnome infrastructure. You can find the repository [...]

  10. mio Says:

    i get this error on ubuntu 64bit:
    checking for clang_createIndex in -lclang… no
    configure: error: could not find clang library

    following the instructions provided by Nadav Vinik did not work..
    any suggestions?
    i would love to have this :)

  11. mio Says:

    ok i did have to use the 64 version in the above.. :P
    now i got it to build
    i had to move the files from /usr/local/lib/gedit/plugins/ to ~/.local/share/plugins/ in order to make it show up in the plugins in gedit
    but now trying to activate the plugin instantly crashes gedit :(

  12. Nacho's Blog » Blog Archive » gedit-code-assistance in f16 Says:

    [...] for languages supported by CLang, that is C, C++ and Objective-C. You can see how it looks in jesse’s post. I just want to indicate in this post that gedit-code-assistance has finally landed on fedora 16. [...]