-
Notifications
You must be signed in to change notification settings - Fork 1
QuickFixScoutTutorial
Yuriy Brun edited this page Jul 23, 2015
·
6 revisions
- Install Quick Fix Scout. (See how to install Quick Fix Scout.)
- Open Eclipse and create a new project called "QFS Tutorial".
- Create a new
class
calledQFSTutorial
in thedefault
package. - Copy and paste the following code:
public class QFSTutorial
{
private string name = "Hello World";
}
You will see:
- Note that:
-
string
is underlined, indicating a compilation error.
- On the left of line 3, a red icon with an X indicates that Eclipse can suggest fixes for this compilation error.
- At the top, a
*
precedesQFSTutorial
, indicating the file is unsaved.
-
- Invoke Quick Fix by clicking on the red icon with an X on the left of line 3. Quick Fix Scout will save the file (the
*
will disappear) and the Quick Fix dialog will open:
- Note three changes as compared to the same dialog without Quick Fix Scout:
- Each Quick Fix suggestion has a number (in parentheses) on the left that indicates how many compilation error will remain after applying this suggestion. For example, the suggestion
Change to 'String'
will fix all compilation errors. ("N/A" or "?" indicate that Quick Fix Scout could not compute the number.)
- The suggestions are sorted by the number of errors they fix.
- Suggestions that fix at least one error are green. Suggestions that fix no errors are black. Suggestions that introduce new errors are red.
- Each Quick Fix suggestion has a number (in parentheses) on the left that indicates how many compilation error will remain after applying this suggestion. For example, the suggestion
Quick Fix Scout can also add new suggestions:
- Adding a method to
QFSTutorial
:
public class QFSTutorial
{
private string name = "Hello World";
public void setName(String newName) {
name = newName;
}
}
You will see:
- Invoke Quick Fix on the second compilation error by clicking on the red icon with an X on the left of line 6. The Quick Fix dialog will open:
- The top suggestion is a new suggestion that you would not see without Quick Fix Scout. Quick Fix Scout found that this suggestion existed for elsewhere in the project, but fixed this error, and more errors than all other local suggestions. Quick Fix Scout makes it clear that this this suggestion is not local in two ways:
- adding the file name, line number, and character number (
QFSTutorial.java:3:13
) after the (0) to indicate from where the suggestion came. (If Quick Fix Scout has trouble computing this location, the (0) will be followed by "!".)
- adding extra context information. For example, here, instead of just saying
"Change to 'String'"
, the suggestion says"Change 'string' to 'String'"
.
- Select the
"Change 'string' to 'String'"
suggestion to fix all compilation errors and complete the tutorial. Congratulations, you have killed two birds (compilation errors) with one stone (suggestion)!
- Please note that Quick Fix Scout does not work when you hover your mouse on the compilation error.
- If any part of the tutorial fails, make sure Quick Fix Scout is installed and configured correctly. See how to install Quick Fix Scout.
- Sometimes, Quick Fix Scout may take a few seconds to update the Quick Fix dialog. Be patient.
- See general Quick Fix Scout troubleshooting guidelines.