Announcement Announcement Module
No announcement yet.
Content Assist broken - SpringSource ( 2.9.2.RELEASE/201205071000) Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Content Assist broken - SpringSource ( 2.9.2.RELEASE/201205071000)

    Hello all,

    I'm having some troubles with the Content Assist feature in STS. It's broken and doesn't seem to find any of my java objects.

    When I search for an object, it doesn't appear as a suggestion when hitting Ctrl-space (nothing shows up actually). I'm forced to manually add the appropriate import line at the top of the file.

    After looking around on the forums, I've made sure that the properties in Preferences->Java->Editor->Content Assist have been properly set (as far as I can tell). The project has no errors, has been refreshed, cleaned and compiled. Adding the import at the top of the file works fine, so that target java class is visibile and on the class path. There don't seem to be any errors in the logs that could make a difference.

    I'm sure it's something simple that I'm missing, but I can't see what. Any ideas?

  • #2
    First, try restarting with the -clean option. It could be that something got corrupted in your configuration area.

    If this doesn't work, take a look at your error log and paste any relevant errors here (or privately send me the entire log if you aren't sure). Are you also saying that things like Java Search are not working?

    A few more questions:

    1. What kind of project is this? Spring? Groovy? Grails? Aspect? Roo?
    2. Is this in all projects or just a single one?
    3. Did this just start happening out of the blue, or is this with a new project or a new install?


    • #3

      Thanks for the reply! The clean seemed to help a little bit, in that Opening a resource found a file that was previously missing, and things have sped up. On the other hand, Opening a type and searching for the same resource doesn't find anything, and the content assist is still broken.

      In the preferences, for content assist->advanced, I have the following items checked:
      -Java non-type
      -java proposals
      -java task proposals
      -Java type proposals

      If I try to search for a certain file, I get a few suggestions (not the one I'm looking for), and they are all shown twice. Playing with the preferences gets me a list with unique options, but still not the one I'm looking for. Just for a sanity check, I've confirmed that manually adding the import works just fine, so everything would seem to be okay on the build-path side of things.

      The project is a maven project (using the maven plugin that came with STS), and the problem shows up in other projects. The project was imported from an existing pom.xml file (several pom files actually. The who project is pretty big). I've also just recently installed STS, so the problem has appeared from the beginning. Strangely enough, if I choose another class to test with, it will work when searching for a type, but not when searching for a resource.

      The only explanation I have is that the maven plugin is somehow screwing up whatever STS uses as a metadata database, though I'm not sure exactly how this can be.

      Any ideas?


      • #4
        The symptoms you are describing are not lending themselves to an explanation. If open resource cannot find the file, but open type can find the type, this implies that the source java file is not actually in the workspace and only the binary file is being found (since open type is built on top of the resource abstraction).

        There also might be some errors. Can you check your error log for relevant entries?

        Window -> Show view -> Other -> Error log


        • #5
          There are no errors in the log, only info messages about proxy ports.

          And your comment about the open type being built on top of the resource abstraction makes sense. As the project is very large, I should probably check my build paths and includes...

          Thanks for the help!


          • #6
            Hello again,

            After checking my build paths, I still can't seem to get the content assist to find a class.

            Here's an example:

            FixWayType wayType = rfq.getFixData().getWay();

            If I ask STS to open the return type of getWay(), it opens just fine. However, the compiler can't seem to find the class FixWayType. Organizing my imports, or asking the content assist to find the file does nothing. If I manually type the import statement at the top of the file, everything is fine, so the file is in the build path.

            I've cleaned and refreshed all the projects involved, with no success..... This is driving me nuts!!!


            • #7
              Please contact me by skype. We can have a chat about this. I am still not sure what is going on and need some more information.

              See the skype id underneath my avatar. It always shows offline for some reason, but it is not necessarily correct. Click it and add me as a contact. I will chat with you about this. I am on North American West coast time.


              • #8
                Hmmm.... Thank you for the offer, but that might be difficult, I'm in France, which will make things tough to find a time slot....


                • #9
                  Available right now.


                  • #10
                    Thank you for the offer, I just read your reply....

                    It actually will be impossible, as the install is on my work computer, and I work for a bank and Skype is on the list of apps that we can't install.... :-(


                    • #11
                      There is something about your project or setup that is not correct. I'm not exactly sure what the problem is that you are having. I need to know exactly what is working and what is not.

                      1. What kind of project is this? Spring? Groovy? Grails? Aspect? Roo?
                      2. Is this in all projects or just a single one?
                      3. Did this just start happening out of the blue, or is this with a new project or a new install?
                      4. Is open type working? Does it display all expected types? If not, which files are missing? Are they grouped in a certain area?
                      5. Is open resource working? Does it display all expected files?
                      6. Is content assist working? Does content assist display anything? Does it work in any files? Create a new, empty java project and create a new class. Does content assist work there?
                      7. Send your project to a colleague. Does your colleague have the same problem?

                      Answer these questions and we can begin to narrow down what is happening.