package bluej.stride.framedjava.errors;
import java.util.Collections;
import java.util.List;
import bluej.stride.framedjava.ast.StringSlotFragment;
import threadchecker.OnThread;
import threadchecker.Tag;
import bluej.stride.framedjava.ast.JavaFragment;
import bluej.utility.javafx.FXRunnable;
| An error which indicates an extra semi-colon at the end of a slot.
| We now prevent semi-colons in most slots, so this should rarely (or never?)
| occur.
|
public class UnneededSemiColonError
extends SyntaxCodeError{
private final FXRunnable fix;
| Creates an error about a semi-colon at the end of a slot, with a quick fix to remove it.
|
| @param slot The slot with the semi-colon
| @param fix An action which will remove the semi-colon
|
@OnThread(Tag.Any)
public UnneededSemiColonError(StringSlotFragment slot, FXRunnable fix)
{
super(slot, "Unnecessary semi-colon at end of slot");
this.fix = fix;
}
@Override
public List getFixSuggestions()
{
return Collections.singletonList(new FixSuggestion() {
@Override
public String getDescription()
{
return "Remove semi-colon";
}
@Override
public void execute()
{
fix.run();
}
});
}
}
top,
use,
map,
class UnneededSemiColonError
. UnneededSemiColonError
. getFixSuggestions
. getDescription
. execute
48 neLoCode
+ 6 LoComm