Gedit class browser for Vala

 Here at Yorba most of us do our development work in Vala using Gedit.  Out of the box, Gedit doesn’t seem like much of an IDE.  But with a few plugins it starts to approach the feature set of a modern development environment.

One feature that’s lacking, though, is a good class browser.  With larger projects this is a must-have tool — scrolling through hundreds of lines of code to find a method seems silly when you can just point and click.

There already is a class browser plugin for Gedit. Caveat: it’s based on ctags.  While ctags is a great library, one language it doesn’t support is Vala.

So is all hope lost? No!  Here’s how to make the aforementioned class browser plugin support Vala.

  1. Install Anjuta. (You’ll see why in a second.)
  2. Install the plugin as described in its readme. Make sure you install the GSettings schema as described.
  3. Open Gedit and enable the plugin. It’s listed as “Source Code Browser.”
  4. In the same window, hit Preferences to open the plugin options.
  5. Next to “ctags executable” change the executable name from “ctags” to “anjuta-tags”.  Anjuta-Tags is a fork of ctags that adds Vala support, GIR support, etc.

Enable your Gedit sidebar (if it isn’t already) to see the class browser tab.  Open a Vala file and you’ll get a nicely formated hierarchical symbol list.

That’s all there is to it. Happy coding!

3 thoughts on “Gedit class browser for Vala”

  1. The class browser plugin for Gedit isn’t necessarily based off of the original ctags; which, as far as I know, is dead. It uses what ever version you have installed.

    I recommend you check out some of the forks of ctags that have popped up. I personally I have contributed several commits to this one on github:

    https://github.com/fishman/ctags

    I’d like to look into getting the Vala implementation from Anjuta ported over. I assume Anjuta only has their own ctags because, as I noted above, the original project on Sourceforge appears to be dead.

Leave a Reply

Your email address will not be published. Required fields are marked *