Search code examples
javaeclipsecontent-assist

Eclipse - Content Assist not working on objects


I stopped programming for about a half a year and yesterday I set up my Android Development Environment. The Content Assist functionality isn't working as I want it to.

Here I would expect it to autocomplete the variablename I declared above. Test

Here I was expecting to get all the methods I can invoke on a String. Notice the error in the bottom left, I don't undestand why I get that. Test2

Here Content Assist actually works the way it's supposed to. enter image description here

I tried it with Eclipse Helios, Indigo and Juno. No idea what the Content Assist is doing there, maybe there is even something wrong with my code? Edit: I also made a new workspace with no success.


Solution

  • Dude, you're not in a "code" area; you're trying to code-complete in a field area - it's expecting a type.

    Try it inside a method:

    public call Test {
        String str_test = "hello world";
    
        void someMethod() {
            str_tes|... <-- it will complete this
        }
    

    Occam's razor - choose between:

    1. A basic feature of Eclipse doesn't work, yet despite the countless programmers that use Eclipse every day, no one's complained about it or created a bug report, but yet you've discovered it right away
    2. Eclipse works just fine and you've just come back to programming from a long break and don't know what you're doing