StSch
StSch

Reputation: 397

Eclipse Code Completion: Is it possible to select a method without the parameters?

The code completion in Eclipse offers the available methods for an object. For a string object I could select this, for example:

lastIndexOf(str, fromIndex).

Is it somehow possible to get only the method lastIndexOf without the parameters (str, fromIndex)?

Upvotes: 0

Views: 193

Answers (2)

allprog
allprog

Reputation: 16790

In Preferences go to: Java->Editor->Content Assist. In the Insertion section uncheck the "Fill method arguments and show guessed arguments" option. After this you will get the method name and the parenthesis after it, no parameters.

enter image description here

Upvotes: 2

sschrass
sschrass

Reputation: 7166

I don't really get your question.

Maybe it helps to understand that a method is more than just its name. A method is distinguished by its method-signature which is in your case lastIndexOf(String, int).

Somewhere in the String-class this very method is defined as lastIndexOf(String str, int fromIndex) and eclipse just looks up that definition and hands it to you. Probably the guy who wrote that method had something in mind as he declared the String as str and the int as fromIndex.

Upvotes: 0

Related Questions