It would have been nice to just reuse the code for code completion from e.g. Eclipse, but I could not do it, it seemed too heavyweight. So the question is whether completion should also avoid all operator evaluation, or whether this is an acceptable risk. I figured it would probably be an acceptable risk, given that developers should generally make operators quick and side-effect free (I already avoid ++ and --), and those few who use different operators can disable tab completion in groovysh.
both getAt() as well as plus() might be implemented with side-effects and/or long running operations, which still would be bad on tab completion.
Now in this situation:
pressing tab evaluates and thus executes the method. This to prevent both undesired side-effects as well as long runtime.
Basically my changes tried to avoid that in this case:
Also I realized in the meantime that groovy allows operator overloading. I had not known this before, so this is a bit of a problem.
I also fixed minor bugs, and added one new feature, completion of filenames within Strings, such as in
Hi,so meanwhile I have rebased my branch and pull reuqest to the latest master, will continue to do so, though no conflicts will happen as long as nobody else works on groovysh.
groovy:000> f = new File('/us|
On Fri, Apr 12, 2013 at 10:52 AM, Cédric Champeau <[hidden email]> wrote:
|Free forum by Nabble||Edit this page|