(this is from my old blog)

A while ago, I was coding an animation widget for work and I needed to calculate a simple but still nontrivial formula and put the result as a constant in my code. Instead of opening an external calculator I decided to create a plugin for IntelliJ.

I wanted to be able to mark a mathematical formula, press CTRL+SHIFT+ALT+C and get the expression replaced with the result.

var duration = 15*60*1000;

…turns in to….

var duration = 90000;

Maybe not the most useful IntelliJ plugin, compared to others, but for me this was the perfect project to learn how to create a simple plugin for IntelliJ (which by the way it the best IDE in all categories!).

I think the result is a good example of how easy it is to develop plugins for IntelliJ.

You can download the plugin from http://plugins.intellij.net/plugin/?id=1494.

Email me if you’re interested in the source code.

Tagged with:
 

One Response to IntelliJ Plugin: Instant Calculator

  1. Gabrielle says:

    I’ll try to put this to good use immedtialey.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>