CompilationUnitDeclaration previousUnitBeingCompleted = this.lookupEnvironment.unitBeingCompleted;
this.lookupEnvironment.unitBeingCompleted = this.compilationUnitDeclaration;
try {
this.hasComputedVisibleElementBindings = true;
Scope scope = this.assistScope;
ASTNode astNode = this.assistNode;
boolean notInJavadoc = this.completionContext.javadoc == 0;
this.visibleLocalVariables = new ObjectVector();
this.visibleFields = new ObjectVector();
this.visibleMethods = new ObjectVector();
ReferenceContext referenceContext = scope.referenceContext();
if (referenceContext instanceof AbstractMethodDeclaration) {
// completion is inside a method body
searchVisibleVariablesAndMethods(scope, this.visibleLocalVariables, this.visibleFields, this.visibleMethods, notInJavadoc);
} else if (referenceContext instanceof TypeDeclaration) {
TypeDeclaration typeDeclaration = (TypeDeclaration) referenceContext;