Oct 29th, 2012, 06:43 AM
Content Assist broken - SpringSource ( 2.9.2.RELEASE/201205071000)
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?
Oct 29th, 2012, 01:49 PM
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?
Oct 30th, 2012, 11:26 AM
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 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.
Oct 30th, 2012, 04:07 PM
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
Nov 6th, 2012, 08:12 AM
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!
Nov 13th, 2012, 05:32 AM
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 FixWayType.java 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!!!
Nov 13th, 2012, 12:28 PM
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.
Nov 16th, 2012, 11:30 AM
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....
Nov 16th, 2012, 11:46 AM
Nov 19th, 2012, 03:00 AM
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.... :-(