Package org.eclipse.jdt.internal.compiler.impl

Examples of org.eclipse.jdt.internal.compiler.impl.ReferenceContext


      CompletionOnQualifiedTypeReference completionOnQualifiedTypeReference = (CompletionOnQualifiedTypeReference) astNode;
      if (completionOnQualifiedTypeReference.isConstructorType){
            context.setTokenLocation(CompletionContext.TL_CONSTRUCTOR_START);
      }
    } else {
      ReferenceContext referenceContext = scope.referenceContext();
      if (referenceContext instanceof AbstractMethodDeclaration) {
        AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration)referenceContext;
        if (methodDeclaration.bodyStart <= astNode.sourceStart &&
            astNode.sourceEnd <= methodDeclaration.bodyEnd) {
          // completion is inside a method body
View Full Code Here


  private int computeRelevanceForSuper(MethodBinding method, Scope scope, InvocationSite site) {
    if (site instanceof CompletionOnMemberAccess) {
      CompletionOnMemberAccess access = (CompletionOnMemberAccess) site;
      if (access.isSuperAccess() && this.parser.assistNodeParent == null) {
        ReferenceContext referenceContext = scope.referenceContext();
        if (referenceContext instanceof AbstractMethodDeclaration) {
          MethodBinding binding = ((AbstractMethodDeclaration) referenceContext).binding;
          if (binding != null) {
            if (CharOperation.equals(binding.selector, method.selector)) {
              if (binding.areParameterErasuresEqual(method)) {
View Full Code Here

          CompletionEngine.this.acceptUnresolvedName(name);
          proposedNames.add(name);
        }
      };

    ReferenceContext referenceContext = scope.referenceContext();
    if (referenceContext instanceof AbstractMethodDeclaration) {
      AbstractMethodDeclaration md = (AbstractMethodDeclaration)referenceContext;

      UnresolvedReferenceNameFinder nameFinder = new UnresolvedReferenceNameFinder(this);
      nameFinder.findAfter(
View Full Code Here

    BlockScope upperScope = scope;
    while (upperScope.enclosingMethodScope() != null) {
      upperScope = upperScope.enclosingMethodScope();
    }

    ReferenceContext referenceContext = upperScope.referenceContext();
    if (referenceContext instanceof AbstractMethodDeclaration) {
      AbstractMethodDeclaration md = (AbstractMethodDeclaration)referenceContext;

      UnresolvedReferenceNameFinder nameFinder = new UnresolvedReferenceNameFinder(this);
      nameFinder.findBefore(
View Full Code Here

            }
            proposedNames.add(name);
          }
        };

      ReferenceContext referenceContext = scope.referenceContext();
      if (referenceContext instanceof AbstractMethodDeclaration) {
        AbstractMethodDeclaration md = (AbstractMethodDeclaration)referenceContext;

        UnresolvedReferenceNameFinder nameFinder = new UnresolvedReferenceNameFinder(this);
        nameFinder.find(
View Full Code Here

 
      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;
View Full Code Here

  private JavaElement getJavaElement(LocalVariableBinding binding) {
    LocalDeclaration local = binding.declaration;

    JavaElement parent = null;
    ReferenceContext referenceContext = binding.declaringScope.referenceContext();
    if (referenceContext instanceof AbstractMethodDeclaration) {
      AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) referenceContext;
      parent = this.getJavaElementOfCompilationUnit(methodDeclaration, methodDeclaration.binding);
    } else if (referenceContext instanceof TypeDeclaration){
      // Local variable is declared inside an initializer
View Full Code Here

  private TypeBinding getTypeFromSignature(String typeSignature, Scope scope) {
    TypeBinding assignableTypeBinding = null;

    TypeVariableBinding[] typeVariables = Binding.NO_TYPE_VARIABLES;
    ReferenceContext referenceContext = scope.referenceContext();
    if (referenceContext instanceof AbstractMethodDeclaration) {
      AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) referenceContext;
      TypeParameter[] typeParameters = methodDeclaration.typeParameters();
      if (typeParameters != null && typeParameters.length > 0) {
        int length = typeParameters.length;
View Full Code Here

      if(this.typePtr > -1) {
        length = this.typePtr + 1;
        foundTypes = new TypeDeclaration[length];
        System.arraycopy(this.types, 0, foundTypes, 0, length);
      }
      ReferenceContext oldContext = Parser.this.referenceContext;
      Parser.this.recoveryScanner.resetTo(initializer.bodyStart, initializer.bodyEnd);
      Scanner oldScanner = Parser.this.scanner;
      Parser.this.scanner = Parser.this.recoveryScanner;
      parseStatements(
          this.enclosingType,
          initializer.bodyStart,
          initializer.bodyEnd,
          foundTypes,
          Parser.this.compilationUnit);
      Parser.this.scanner = oldScanner;
      Parser.this.referenceContext = oldContext;

      for (int i = 0; i < length; i++) {
        foundTypes[i].traverse(this.typeVisitor, scope);
      }
    }
    public void endVisit(MethodDeclaration methodDeclaration, ClassScope scope) {
      endVisitMethod(methodDeclaration, scope);
    }
    private void endVisitMethod(AbstractMethodDeclaration methodDeclaration, ClassScope scope) {
      TypeDeclaration[] foundTypes = null;
      int length = 0;
      if(this.typePtr > -1) {
        length = this.typePtr + 1;
        foundTypes = new TypeDeclaration[length];
        System.arraycopy(this.types, 0, foundTypes, 0, length);
      }
      ReferenceContext oldContext = Parser.this.referenceContext;
      Parser.this.recoveryScanner.resetTo(methodDeclaration.bodyStart, methodDeclaration.bodyEnd);
      Scanner oldScanner = Parser.this.scanner;
      Parser.this.scanner = Parser.this.recoveryScanner;
      parseStatements(
          methodDeclaration,
View Full Code Here

  int priority = 10000 - problem.getSourceLineNumber(); // early problems first
  if (priority < 0) priority = 0;
  if (problem.isError()){
    priority += P_ERROR;
  }
  ReferenceContext context = this.problemsMap == null ? null : (ReferenceContext) this.problemsMap.get(problem);
  if (context != null){
    if (context instanceof AbstractMethodDeclaration){
      AbstractMethodDeclaration method = (AbstractMethodDeclaration) context;
      if (method.isStatic()) {
        priority += P_STATIC;
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.impl.ReferenceContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.