When groovy is installed on a machine you can launch groovy scripts through double click on Windows or even like shell scripts on UNIX. Since my department is very Java-centric we've been starting to use groovy instead of bash/perl/python scripts to do small tasks. It would be nice to be able to use IDEA effectively on such files.
I can get a really lightweight editor for groovy by dragging groovy script into IDEA, on whatever project I happen to be open. This gets me a syntax-aware editor, but it works horribly because everything is highlighted in red as IDEA does not even recognize the standard Groovy classes, and because of this of course there is no auto-complete. This happens even if I drag open the file in a project window that is using Groovy.
My current solution if I need to make a big change is to create a blank Maven project/POM referencing groovy jar. Then I copy scripts into that project, edit, then copy them back to the desired location. This works, but is annoying because I'm manually "syncing" files around. Or, if I make a small change I just use text editor like VIM, but IDEA is much better than VIM.
Scripts can be found anywhere on the file system, I don't want to have to setup a whole IDEA project just to edit one small groovy script. Is there a better solution that fits these requirements:
- Edit in an ad-hoc manner groovy script/class files not in a project/coding setting?
- No need to create a project -- I don't want .idea folders scattered all around my disk.
- I don't care to compile the groovy files
- Still support the groovy feature when A.groovy and B.groovy are in the same directory, A can reference B ("groovy classpath"). If this means IDEA opening all *.groovy in a directory, that's good.
I'm OK with any solution that requires one-time setup like installing groovy in some place and/or selecting "default" groovy jars to reference from IDEA, etc.