Description
Source locations of command chain expressions are incorrect. Consider the following snippet (no whitespace before or after expression):
foo bar baz
Type that into the groovyConsole and inspect the AST. Expand a few sections and see that the this.foo(bar) method call has a columnNumber of 5, whic is incorrect. Expand one more level and see that the foo constant expression has a columnNumber of 1, which is correct.
In Groovy-Eclipse, we have put a bit of a kludgy patch in to make it work. At the end of the methodCallExpression(AST) method, immediately before the return statement, we added this text:
// in the case of Groovy 1.8 command expressions, the slocs are incorrect for the start of the method if (!implicitThis && methodCallNode.getText().equals("<command>")) { ret.setStart(objectExpression.getStart()); ret.setLineNumber(objectExpression.getLineNumber()); ret.setColumnNumber(objectExpression.getColumnNumber()); ret.setEnd(arguments.getEnd()); ret.setLastLineNumber(arguments.getLastLineNumber()); ret.setLastColumnNumber(arguments.getLastColumnNumber()); }
I'm not particularly happy with this solution, but it works for us. Perhaps you can come up with something better.