Poor Man's Quick Fixes Eclipse Plugin

 

Description

logo This plugin adds a generic quick fix ability to Eclipse. New quick fixes can be defined by specifying regular expressions and message format strings.

Screenshots

1. Change array.length to list.size():

Screenshot 1

2. Change array[index] to list.get(index):

Screenshot 2

3. Change list.get(index) to array[index]:

Screenshot 3

4. Change to constructor call:

Screenshot 4

News

November 5th, 2006: Version 1.0.2 released
  • Added new quick fix "Change to constructor call"
  • A relevance value (0..100) can be defined for each quick fix
August 25th, 2006: Version 1.0.1 released as first public version

Requirements

JRE 1.5 and Eclipse 3.2 or greater installed (tested with 3.2 and 3.3M3)

License

CPL1.0

Download

download poormansquickfixes_1.0.2.zip 64KB

Installation

Unzip the file to the Eclipse folder, e.g. C:\Program Files\eclipse

Details

This project is kind of an experiment:

The plugin comes with four simple quick fix definitions included, e.g. for fixing array / List related compile errors. The concept of defining quick fixes by regular expressions and message format string works fine on those examples. However I am not yet sure if it will work well with others.

So please check it out and let me know if you find more useful quick fix definitions. You can export configured fixes as xml and send the file by mail. Don't forget to include example snippets.

How to...

How to add a new quick fix

1. Right click at a Java compile error to find out its problem id:
screenshot screenshot
2. Open the "Poor Man's Quick Fixes" preferences page and hit "Add" to define a new quick fix:
screenshot
3. Paste the problem id from the clipboard:
screenshot
4. Specify the regular expression that matches the problem string. Make groups for each part of the string you want to keep in the fix:
screenshot
5. Specify a message format string to define the replacement. The message format will be filled in with the regular expression groups:
screenshot
6. Don't forget to add a name. You can use a messageformat string here, too:
screenshot
7. That's it. If it does not work please check the regular expression: it will only work if it matches the text part, that is being underlined in red wiggly lines in the Java editor.
Valid XHTML 1.0!
© Markus Gebhard (markus@jave.de), 2004 - 2008
last modified: May 4, 2008