Tuesday, November 7, 2017

Macro keyboard recording on Eclipse / LiClipse 4.3.1

I'm currently working on a new engine for record and playback of keyboard macros in Eclipse. It's currently available as a project in the Eclipse incubation (see https://wiki.eclipse.org/E4/Macros for more details and how to install it to Eclipse) and I hope it'll be a part of Eclipse 4.8 -- the current version should be stable already, but it needs some hardening, so, feedback is appreciated ;)

Also, I decided to integrate it into LiClipse too (so, the new 4.3.1 release of LiClipse adds support to record and playback of macros).

The idea is that this will fix a long standing (and popular) feature request in Eclipse -- https://bugs.eclipse.org/bugs/show_bug.cgi?id=8519 -- and a pet peeve on mine too as it's not uncommon for me to copy a file to notepad++ to make a record/playback and then copy it back to Eclipse... this really should be builtin (as a note, the rectangular edition in Eclipse, multiple cursors in LiClipse  and regexps in the find dialog do solve a number of use-cases, but I find that record/playback on some cases is invaluable).

Now, why not just use https://sourceforge.net/projects/practicalmacro/? Well, I've used it some times but unfortunately I didn't find it as stable as I wanted -- it's really hard to come up with a stable record of what's happening in Eclipse -- so, I think an effective solution must really be builtin to Eclipse in order to be effective.

Also, in order to be feasible, there are some limitations in the scope on what it should accomplish: it's not a general Eclipse IDE record/playback, but rather a record/playback in the scope of an editor, so, it should properly record/playback the keystrokes in the editor and the resulting actions from such commands (although the implementation is done in a way which could support more general recording in Eclipse, but this would require changing many other parts of the IDE to be aware of the macro record/playback, so, I'm not sure it'd be feasible).

This means that some particular implementations which don't work through commands will have to be adapted -- so, for instance, record in the find dialog currently doesn't work because it doesn't work through commands and there's no way to listen that a find action was actually triggered from there... right now, the workaround is using the Incremental Find (Ctrl+J) and Find Next (Ctrl+K) commands when on record mode (my idea is taking a look at it after the macro record/playback engine is integrated to core Eclipse as I don't think it's a blocker due to having a proper workaround through actual commands), the focus now is making it solid for record and playback of commands which are related to the text editor.

So, that's it, hope you enjoy macro recording on LiClipse 4.3.1 -- and hopefully on Eclipse itself later on ;)