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.
- Install Anjuta. (You’ll see why in a second.)
- Install the plugin as described in its readme. Make sure you install the GSettings schema as described.
- Open Gedit and enable the plugin. It’s listed as “Source Code Browser.”
- In the same window, hit Preferences to open the plugin options.
- 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!
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.
The ctags fork they recommend is Exuberant Ctags, which is still actively developed.
I hate to do this…. but did you read the graph? The blue line is reads. The green one is writes.
That green line looks pretty flat to me…