The Ultimate Code Browser

I want a Firefox Plugin that recognizes that the page I’m looking at contains Java, does syntax highlighting and, most of all, inserts links to the classes and methods referenced in the code. The plugin (or a server it can ask) should know where the source code of a class like org.springframework.beans.factory.BeanFactory can be found.

First I thought that such a plugin would need (or could at least profit from) sem***ic web technologies (no dirty words on this blog, please), but it probably wouldn’t. All we need is a global registry that maps package names to the URLs of the web interfaces of the respective source repositories. (Maybe Google Code Search could be such a repository, but its results are often pretty bad.) The plugin would also have to include a reasonably good Java parser, and maybe a heuristic to distinguish betweeen Java and non-Java text.

Why would I want such a thing? Well, I often have to dig through the code of some open source library in order to understand a bug, or just to figure out what I can do with it, and how, because the documentation is incomplete or wrong. Usually I create an Eclipse project and import the code from the source repository, but that’s quite a lot of overhead if I just need to browse the code for ten minutes or so. On the other hand, digging through source code on web pages, without the help of links between the pages, is just a nuisance.

And wouldn’t it just be so cool to have one of the most important features of an IDE as a browser plugin, enhanced by the power of the world wide web?

P.S.: Or maybe I don’t want a browser plugin - maybe I just want Google to put some more effort into Code Search? Come on, guys, you’ve got all it takes - the global repository, the parsers, the heuristics…

3 Responses to “The Ultimate Code Browser”

  1. Andy
    June 11th, 2008 | 5:40 pm

    Check Koders.com for better code search and various browser- and IDE-plugins as well as an API you can use…

  2. June 11th, 2008 | 5:52 pm

    Or checkout krugle.org, which includes a browseable project tree pane alongside the code files, so you can see the code in context.
    [Disclaimer: I work for Krugle]

  3. chrisahn
    June 19th, 2008 | 9:04 pm

    Thanks guys. I tried koders and krugle, but they both are a long way from what I want.

    I tried to find the source code for org.springframework.beans.factory.BeanFactory, the most important interface of Spring. Neither koders nor krugle had it in the first few dozen search results, though both found many other classes that reference that interface.

    On koders.com, I managed to get the BeanFactory source code by clicking through the folder hierarchy of the spring CVS repository, but when I click on the name of a linked class, say NoSuchBeanDefinitionException, I just get back to the search results for that name instead of directly to the class.

    On krugle, some other source code that I managed to find did not contain links at all. The only way to get from one class to the next seems to be pasting the class name into the search box…

    In my IDE, I can look at the source code of a class, click on a class or method name referenced by it, and get directly to the code for that class or method. Of course, that only works if I tell my IDE where to find the source code of all those classes - which shouldn’t be necessary. When I click on a class name, I want my browser or my IDE or whatever to get the source code from somewhere on the web, add syntax highlighting and links, and show it to me. I want to jump from one class to the next without having to install any source code, and without entering class names into a search box.

    I hope one day Krugle / Koders / Google / Eclipse or whoever will implement that! All we really need is a global registry that maps class names to URLs…

Leave a reply

Warning: comments containing links will be eaten by our spam protection.