import net.sourceforge.phpdt.core.IPackageFragment;
import net.sourceforge.phpdt.core.IType;
import net.sourceforge.phpdt.core.JavaModelException;
+import net.sourceforge.phpdt.core.WorkingCopyOwner;
import net.sourceforge.phpdt.core.compiler.CharOperation;
import net.sourceforge.phpdt.core.search.IJavaSearchConstants;
import net.sourceforge.phpdt.core.search.ITypeNameRequestor;
import net.sourceforge.phpdt.internal.codeassist.ISearchRequestor;
import net.sourceforge.phpdt.internal.codeassist.ISearchableNameEnvironment;
import net.sourceforge.phpdt.internal.compiler.env.IConstants;
+import net.sourceforge.phpdt.internal.compiler.env.INameEnvironment;
import net.sourceforge.phpdt.internal.compiler.env.ISourceType;
import net.sourceforge.phpdt.internal.compiler.env.NameEnvironmentAnswer;
protected ICompilationUnit unitToSkip;
protected IJavaProject project;
- // protected IJavaSearchScope searchScope;
+ //protected IJavaSearchScope searchScope;
+ /**
+ * Creates a Sea
/**
* Creates a SearchableEnvironment on the given project
*/
// Create search scope with visible entry on the project's classpath
// this.searchScope = SearchEngine.createJavaSearchScope(this.project.getAllPackageFragmentRoots());
}
+
+
+ /**
+ * Creates a SearchableEnvironment on the given project
+ */
+ public SearchableEnvironment(JavaProject project, WorkingCopyOwner owner) throws JavaModelException {
+ this.project = project;
+ this.nameLookup = project.newNameLookup(owner);
+
+ // Create search scope with visible entry on the project's classpath
+// this.searchScope = SearchEngine.createJavaSearchScope(this.project.getAllPackageFragmentRoots());
+ }
/**
* Returns the given type in the the given package if it exists,
* otherwise <code>null</code>.
if (packageName == null)
packageName = IPackageFragment.DEFAULT_PACKAGE_NAME;
+ if (this.nameLookup!=null) { // ins axelcl
IType type = this.nameLookup.findType(typeName, packageName, false, NameLookup.ACCEPT_CLASSES | NameLookup.ACCEPT_INTERFACES);
if (type != null) {
// if (type instanceof BinaryType) {
}
// }
}
+ }
return null;
}