Bug 6670 - Code Assist: Cannot resolve in method body
Summary: Code Assist: Cannot resolve in method body
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 6629 6674 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-12-07 09:33 EST by John Wiegand CLA
Modified: 2002-01-14 10:37 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Wiegand CLA 2001-12-07 09:33:55 EST
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.
Comment 1 Philipe Mulet CLA 2001-12-07 11:39:10 EST
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.
Comment 2 John Wiegand CLA 2001-12-07 12:29:35 EST
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.
Comment 3 Philipe Mulet CLA 2001-12-07 17:46:19 EST
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...).

Comment 4 Philipe Mulet CLA 2001-12-07 17:47:17 EST
*** Bug 6674 has been marked as a duplicate of this bug. ***
Comment 5 Philipe Mulet CLA 2001-12-07 18:52:52 EST
*** Bug 6629 has been marked as a duplicate of this bug. ***