iSnippet

Search for code samples from within IDEA.    Download
-Anki R Nelaturu [anki@rapidminds.com]

How to use it


IDEA behind iSnippet

Often we, the developer will be searching for some code samples. It is trivial that the developers goes to Internet and search on some words and browse through all the links and find (if they are lucky) whatever needed and copy the code snippet, paste in the editor, make modifications .... blah blah blah.

The idea is like this. Assume that there are some code samples available on some known website. And, assume that these pahes follows some format on how each code sample is diaplayed. Knowing this information, we can write a program to fetch the links from this website and search for what we wanted.

The iSnippet does exactly the same thing. TO demonstrate the above scenario, iSnippet searched in JavaDevelopers Almanac website for code samples from within IDEA and it displays the code in a code-only view. Developer can simple paste it into the current editor.

Because time is not permitting me to spend more time on this plugin development, I couldn't implement many things. Following is the list of features that I wanted to have in this plugin.

1. Configurable Search Agents A page in settings, where developers can add more search agents. Some kind of API is there in the plug-in, so that developers can write their own SearchAgent and add those classes to the plugin.
For example, if there is an agent, which can search code.google.com and filter out the Java related things and display it in the IDEA, then that agent can be implemented as a Java module and the class can be added to iSnippet, as long as it implements required interfaces.

2. Able to create IDEA templates from these code snippets. Right now in this proto-type, only Paste can be done into the current editor. But, if a template can be generated out of this example, it will be more usable within IDEA. Requires little parsing and making some adjustments to the code, but not sure if there is an OpenAPI to create templates on the fly.

3. Maintaining a server with some code sample to demonstrate the extensibility of SearchAgents :) Because of my job, I couldn't spend any more time on this. Other wise I thought of having some web site with about 50 code samples and provide an example code to extend the Search Agents.

What Am I Thinking: The IDEA is great tool. If the community provides all code samples and accumulated at one place (on one of JetBrains sub-domains, lets say snippets.intellij.net), then it will be more usefull for the developers, mostly for the beginners.

more screenshots