Question

I'm completely new to Java and learning it coming from a C# background.

I have Eclipse installed as my IDE of choice currently; and I've tried to set up the 'Content Assist' so that it works like Intellisense in Visual Studio; i.e it pops up as soon as I start typing anything.

However, I've noticed that it irritatingly appends things on the end of my field names when I press the semicolon key. For example, if I type:

private String firstName

Then when I add the semicolon (provided I'm fast enough), I get this:

private String firstNameString;

Is there some way to turn that off? I couldn't see any way in the preferences.

Était-ce utile?

La solution 3

I found the answer after about a year of Java: Use IDEA.

Autres conseils

I spoke to someone in the Eclipse IRC channel and was told that this functionality can't be disabled. In fact, for people like me who are used to C# and VS's Intellisense, there is no real solution.

The only two options are:

1: To revert to the standard option of having the Content Assist list pop up only when you press '.' (though it can be opened manually with Ctrl+Space at any time, I don't like having to do this extra combo every time, especially for a learner)

2: Keep it like intellisense but put up with Eclipse autocompleting field names whenever I enter a semicolon.

To be honest, neither option seems satisfactory, so I'd suggest trying other IDEs for Visual Studio fans looking to migrate, like me.

Don't know how to set up the Content Assist Eclipse feature to work like the VS intellisense, but, in Window > Preferences > Java > Editor > Content Assist > Advanced, there are 2 list, if you uncheck "Java Proposals" in both of them and check "Java Type Proposals", you should fix the type name suffix auto insertion problem.

enter image description here

Also, you could try NetBeans, it is a based java IDE with good Autocompletion capabilities (it also could show documentation alongside autocompletion and insert code templates as Visual Assist does)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top