Skip to content

Commit

Permalink
Merge pull request #358 from laeubi/issue357
Browse files Browse the repository at this point in the history
Fix #357
  • Loading branch information
laeubi authored Apr 15, 2019
2 parents 0d144e1 + 229762d commit 40f6a4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public MarkerFormatter(IDocument document, IResource gherkinFile, MarkerFactory

@Override
public void syntaxError(String state, String event, List<String> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<PositionedElement> stack = new Stack<PositionedElement>();

Expand All @@ -70,8 +70,7 @@ public void uri(String arg0) {
}

@Override
public void syntaxError(String arg0, String arg1,
List<String> arg2, String arg3, Integer arg4) {
public void syntaxError(String state, String event, List<String> legalEvents, String uri, Integer line) {
}

@Override
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 40f6a4b

Please sign in to comment.