[ANN] IdeaScript v.0.1 (Prototype Release)

IdeaScript is an Ant-like scripting language for Idea. It allows you to easily create scripts to codify repetitive tasks in our favorite IDE. The architecture is easily extendable so you can quickly create commands to make your scripts do whatever you want (or more precisely, whatever Idea's Open-API will let you).

Using IdeaScript, you can:

  • Create classes, methods, fields, etc.

  • Navigate to files, classes, or members within classes

  • Move the cursor anywhere around the editor and

edit the contents of the editor (cut, copy, paste,
etc.)

  • Other miscellaneous commands


This plugin is probably not for everyone but I already find it useful so I thought I'd share what I have so far. This is the first public release and as such I hope to elicit developer comments and criticism. Where I am most interested in feedback is the currently chosen element names for the commands and the names of their properties. (Since changing these down the line will break people's scripts.) Also, I'd like to hear suggestions on commands that aren't present yet but that you would find useful.

IdeaScript is available at:
http://www.intellij.org/twiki/bin/view/Main/IdeaScript

Please read that page completely so you don't miss anything. A short tutorial is also available from that page.

10 comments
Comment actions Permalink

What version of IDEA is this plugin working with?

Excellent idea!

Marius

Kirk Woll wrote:

IdeaScript is an Ant-like scripting language for Idea. It allows you to easily create scripts to codify repetitive tasks in our favorite IDE. The architecture is easily extendable so you can quickly create commands to make your scripts do whatever you want (or more precisely, whatever Idea's Open-API will let you).

Using IdeaScript, you can:

  • Create classes, methods, fields, etc.

  • Navigate to files, classes, or members within classes

  • Move the cursor anywhere around the editor and

edit the contents of the editor (cut, copy, paste,
etc.)

  • Other miscellaneous commands


This plugin is probably not for everyone but I already find it useful so I thought I'd share what I have so far. This is the first public release and as such I hope to elicit developer comments and criticism. Where I am most interested in feedback is the currently chosen element names for the commands and the names of their properties. (Since changing these down the line will break people's scripts.) Also, I'd like to hear suggestions on commands that aren't present yet but that you would find useful.

IdeaScript is available at:
http://www.intellij.org/twiki/bin/view/Main/IdeaScript

Please read that page completely so you don't miss anything. A short tutorial is also available from that page.


0
Comment actions Permalink

It is supposed to work with Ariadna and Aurora via a pluggable interface for all the incomatible API methods between the versions. I'm not by my development box now, though, so I can't check to see if it's broken. But it should work. :) I'll check when I get home.

0
Comment actions Permalink

How about using JavaScript (or BeanShell perhaps) to script OpenAPI?


"Kirk Woll" <kirk@digimax.com> wrote in message
news:20728570.1061332563584.JavaMail.itn@is.intellij.net...

IdeaScript is an Ant-like scripting language for Idea. It allows you to

easily create scripts to codify repetitive tasks in our favorite IDE. The
architecture is easily extendable so you can quickly create commands to make
your scripts do whatever you want (or more precisely, whatever Idea's
Open-API will let you).
>

Using IdeaScript, you can:

  • Create classes, methods, fields, etc.

  • Navigate to files, classes, or members within classes

  • Move the cursor anywhere around the editor and

edit the contents of the editor (cut, copy, paste,
etc.)

  • Other miscellaneous commands

>

This plugin is probably not for everyone but I already find it useful so I

thought I'd share what I have so far. This is the first public release and
as such I hope to elicit developer comments and criticism. Where I am most
interested in feedback is the currently chosen element names for the
commands and the names of their properties. (Since changing these down the
line will break people's scripts.) Also, I'd like to hear suggestions on
commands that aren't present yet but that you would find useful.
>

IdeaScript is available at:
http://www.intellij.org/twiki/bin/view/Main/IdeaScript

>

Please read that page completely so you don't miss anything. A short

tutorial is also available from that page.


0
Comment actions Permalink

You already can. Dmitry Skavish has a fine plugin to let you do that with BeanShell. I can turn the question around, though, and ask: Why don't you use BeanShell or JavaScript to do build scripts instead of Ant? Personally I find the XML more readable, managable, and promotes object reuse through the use of new commands/tasks.

0
Comment actions Permalink

I agree. Hovewer if you develop all ANT tasks in JavaBean form + develop
runtime to execute those tasks in I am not sure I would not switch to
Velocity or BeanShell or something like this to script them - I am a bit
tired of lack of real flow control in ant ...

"Kirk Woll" <kirk@digimax.com> wrote in message
news:32587091.1061347708802.JavaMail.itn@is.intellij.net...

You already can. Dmitry Skavish has a fine plugin to let you do that with

BeanShell. I can turn the question around, though, and ask: Why don't you
use BeanShell or JavaScript to do build scripts instead of Ant? Personally
I find the XML more readable, managable, and promotes object reuse through
the use of new commands/tasks.


0
Comment actions Permalink

I understand what you are saying. To be honest, the reason I favor the XML approach is because I've spent quite a fair bit of time programming plugins for Idea (for other people in our company) and have not found the experience entirely a pleasure. One of the main reasons has been because storing the code that you want to print out (for example, the skeleton of a class, say) is very awkward in code. Plus, replacing the parts of that skeleton with dynamic data (like the class name, say) is not convenient. With the XML approach the code is neatly contained inline (like with Live Templates) in a very readable fashion as opposed to a series of println statements trying to do the same thing in code. Like in Ant, variable evaluation is an intuitive and easy to read way to substitute parts of code you generate with dynamic data.

I think you do sacrifice some flexibility, especially when it comes to creative flow control, and that's why I don't think it's for everyone, or at least, not for everyone all the time.

0
Comment actions Permalink

Did you look at velocity? I find it more readable than XML. It is simple and does not give you too much power in the "view" side to burn yourself.
However it doesn't provide a way to extend the base language (which is both good and bad): all data production for rendering must be done before in java where you have the most control over the transformation.
IMHO a very nice division. It was extremely simple to put in place for the JunitPlugin and integrate nicely with IDEA own template mechanism which is a plus.

Jacques

0
Comment actions Permalink

No, I hadn't looked at Velocity. Now I have, though, and it seems to me like a programming language that seemlessly allows you to output string content like code or html. That's nice, and definitely offers an advantage over beanshell or javascript. However, a pretty important requirement is ease of use for the developer, and one thing I liked about the XML approach is that I was able to dynamically generate a DTD for all the possible XML elements (commands/tasks) such that Idea provides nice code-insight/parameter-insight for IdeaScript like it does for Ant. I have no clue how I'd be able to pull that off if I went with Velocity or the like. In the end, though, perhaps it's just due to my familiarity with XML, but I personally think the XML approach is still more clear and readable. While allowing things like for loops provides more power, I think it does end up decreasing readability.

0
Comment actions Permalink

Kirk, where can I find idea-script.dtd.
I cannot find it neither in .jar nor in sources.

IMHO you should write short reference, what commands are available to
IdeaScript user.
Tutorial is neat, but it explains only one particular example. We need a
reference, or atleast,
a commented DTD.


U¿ytkownik "Kirk Woll" <kirk@digimax.com> napisa³ w wiadomo¶ci
news:20728570.1061332563584.JavaMail.itn@is.intellij.net...

IdeaScript is an Ant-like scripting language for Idea. It allows you to

easily create scripts to codify repetitive tasks in our favorite IDE. The
architecture is easily extendable so you can quickly create commands to make
your scripts do whatever you want (or more precisely, whatever Idea's
Open-API will let you).
>

Using IdeaScript, you can:

  • Create classes, methods, fields, etc.

  • Navigate to files, classes, or members within classes

  • Move the cursor anywhere around the editor and

edit the contents of the editor (cut, copy, paste,
etc.)

  • Other miscellaneous commands

>

This plugin is probably not for everyone but I already find it useful so I

thought I'd share what I have so far. This is the first public release and
as such I hope to elicit developer comments and criticism. Where I am most
interested in feedback is the currently chosen element names for the
commands and the names of their properties. (Since changing these down the
line will break people's scripts.) Also, I'd like to hear suggestions on
commands that aren't present yet but that you would find useful.
>

IdeaScript is available at:
http://www.intellij.org/twiki/bin/view/Main/IdeaScript

>

Please read that page completely so you don't miss anything. A short

tutorial is also available from that page.


0
Comment actions Permalink

The DTD is dynamically genereated by IdeaScript each time you start up Idea. Currently, it is placed in IDEA_HOME/plugins/scripts/idea-script.dtd. The main home page mentions this, in addition to a blurb about how to set this up as a resource in Idea.

I have been meaning to create more docs, and I'll try to get to that this weekend. Thanks for the suggestion. :)

Kirk

0

Please sign in to leave a comment.