X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SearchableEnvironment.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SearchableEnvironment.java index 6bc4edc..a7795eb 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SearchableEnvironment.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SearchableEnvironment.java @@ -16,12 +16,14 @@ import net.sourceforge.phpdt.core.IJavaProject; 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; @@ -36,8 +38,10 @@ public class SearchableEnvironment implements ISearchableNameEnvironment, IJavaS protected ICompilationUnit unitToSkip; protected IJavaProject project; - // protected IJavaSearchScope searchScope; + //protected IJavaSearchScope searchScope; + /** + * Creates a Sea /** * Creates a SearchableEnvironment on the given project */ @@ -48,7 +52,19 @@ public class SearchableEnvironment implements ISearchableNameEnvironment, IJavaS // 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 null.