This site requires JavaScript, please enable it in your browser!
Greenfoot back
winnerpig
winnerpig wrote ...

2011/11/14

why not have code auto-completion function?

winnerpig winnerpig

2011/11/14

#
I'v downloaded the latest geenfoot version, and the IDE can't have code auto-completion.Why?
nccb nccb

2011/11/14

#
What do you mean by "can't have"? Do you mean that code completion is broken for you? In one of your actors, inside a method, type:
Greenfoot.
And then hit Ctrl-Space (hold Control, press Space) after you've typed the dot. You should get a list of methods with things like "delay(int)", "getKey()" and so on.
hotrails hotrails

2011/11/14

#
winnerpig is referring to code auto-completion, why don't you nccb?
bourne bourne

2011/11/14

#
@hotrails, nccb was referring to code auto-completion. You have to hit ctrl-space after the dot for it to appear. Or do you mean for it to guess what you are going to type and highlight the remaining text for you? In which case, no it does not exist.
winnerpig winnerpig

2011/11/15

#
I'v found this , however I want to know whether the IDE could cast auto completion immediately after the dot , as the feature in eclipse. Thanks for replying!
nccb nccb

2011/11/15

#
It was a deliberate design decision on our part. We didn't want to confuse novice programmers by making things pop-up unexpectedly. In our tutorial, about the fourth line of code that beginners are told to write is:
if (Greenfoot.isKeyDown("left")) ...
If auto-completion after the dot was on by default, they would get a menu pop-up which they would probably stop and read, rather than just writing the code. So keeping it on a manual shortcut means that it can be introduced to beginners when the time is right. We could, of course, have a menu item allowing the dot-popup feature to be turned on. But the feature in general is tricky: you don't want the popup to appear after dots in import statements, string literals and decimal points in numbers, and making sure that it appears only in the right places is extra effort on our part for little gain. (And you'd still need the shortcut, because you can use auto completion without a dot, when you're calling methods in the current class.)
winnerpig winnerpig

2011/11/17

#
Thanks! I know now!
You need to login to post a reply.