Community
Participate
Working Groups
build 1206. 1. Use the plugin importer to create projects for all of the 1206 drop. 2. Create a project test; add boot, runtime, resources to the classpath 3. Create a compilation unit import org.eclipse.core.resources.IFile; public class MyClass { public void validateSave(IFile f) { S } 4. I cannot get code assist to work inside of validateSave. I get only template completions on S.
Cannot reproduce. Took a straight 1206 build, created a new workspace. Imported all plugins from 1206 as projects (using the copy library option), added project with 3 prereqs, and then added compilation unit in default package (through wizard). Was able to perform completions inside the method body without any problem. I am running the host IDE on Standard VM 1.4 beta 3.
The problem is more subtle. If you do a failing code assist because of a bad classpath, nothing will work from then on. More accurate steps: build 1206. 1. Use the plugin importer to create projects for all of the 1206 drop. 2. Create a project test; DO NOT edit the classpath. 3. Create a compilation unit import org.eclipse.core.resources.IFile; public class MyClass { public void validateSave(IFile } 4. Do code assist on IFile. This doesn't work since the classpath is wrong. 5. add boot, runtime, resources to the classpath 6. Now do code assist on IFile. This time it works. 7. I cannot get code assist to work inside of validateSave. If I define the arg and then start on System.out.println, I cannot code assist anything. Nor can I do type hierarchies or open on selection in the project.
Problem understood. After having performed the first codeassist, the project namelookup got initialized with all packages visible to the project. Then the classpath got changed by adding more prerequisite projects, but no change in the direct children of the project (local roots visible in the package view), thus we do not re-initialize the namelookup as per JavaProject#updatePackageFragmentRoots. Some update needs to happen when changing the project prereq chain as well. From there on, any type resolution against the Java model is doomed (hierarchy, open on selection, search, etc...).
*** Bug 6674 has been marked as a duplicate of this bug. ***
*** Bug 6629 has been marked as a duplicate of this bug. ***