A quick update on the gedit clang integration. Here is a screenshot of the latest visualization of errors in source code:
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).
Wow, this is really impressive :)
Nice!
Any chance of this being ported to Anjuta?
//Marcus
This is awesome. Thanks for the time and effort you put into improving gedit and working on awesome plugins like this and gedit-collaboration.
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.
@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.
Will this work with other languages clang supports, like C++ and Objective-C?
@jordy: indeed
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)
Pingback: jessevdk » gedit code assistance plugin
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 :)
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 :(
Pingback: Nacho's Blog » Blog Archive » gedit-code-assistance in f16