diff --git a/cucumber.eclipse.editor/src/main/java/cucumber/eclipse/editor/builder/CucumberGherkinBuilder.java b/cucumber.eclipse.editor/src/main/java/cucumber/eclipse/editor/builder/CucumberGherkinBuilder.java index 36277eb8..c7603cc2 100644 --- a/cucumber.eclipse.editor/src/main/java/cucumber/eclipse/editor/builder/CucumberGherkinBuilder.java +++ b/cucumber.eclipse.editor/src/main/java/cucumber/eclipse/editor/builder/CucumberGherkinBuilder.java @@ -333,7 +333,7 @@ public MarkerFormatter(IDocument document, IResource gherkinFile, MarkerFactory @Override public void syntaxError(String state, String event, List legalEvents, String uri, Integer line) { - this.markerFactory.syntaxErrorOnGherkin(this.gherkinFile, new ParseException(event, line)); + this.markerFactory.syntaxErrorOnGherkin(this.gherkinFile, "Found "+event+" when expecting one of: "+legalEvents+". (Current state: "+state+").", line); } @Override diff --git a/cucumber.eclipse.editor/src/main/java/cucumber/eclipse/editor/editors/GherkinModel.java b/cucumber.eclipse.editor/src/main/java/cucumber/eclipse/editor/editors/GherkinModel.java index 04970e8e..f963a33e 100644 --- a/cucumber.eclipse.editor/src/main/java/cucumber/eclipse/editor/editors/GherkinModel.java +++ b/cucumber.eclipse.editor/src/main/java/cucumber/eclipse/editor/editors/GherkinModel.java @@ -61,7 +61,7 @@ public PositionedElement getStepElement(int offset) throws BadLocationException public void updateFromDocument(final IDocument document) { elements.clear(); - Parser p = new Parser(new Formatter() { + Formatter formatter = new Formatter() { private Stack stack = new Stack(); @@ -70,8 +70,7 @@ public void uri(String arg0) { } @Override - public void syntaxError(String arg0, String arg1, - List arg2, String arg3, Integer arg4) { + public void syntaxError(String state, String event, List legalEvents, String uri, Integer line) { } @Override @@ -157,7 +156,8 @@ public void startOfScenarioLifeCycle(Scenario arg0) { // TODO Auto-generated method stub } - }); + }; + Parser p = new Parser(formatter, false); try { p.parse(document.get(), "", 0);