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

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


    BlockScope scope = this.declaringScope;
    int occurenceCount = 0;
    if (scope != null) {
      // the scope can be null. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=185129
      MethodScope methodScope = scope instanceof MethodScope ? (MethodScope) scope : scope.enclosingMethodScope();
      ReferenceContext referenceContext = methodScope.referenceContext;
      if (referenceContext instanceof AbstractMethodDeclaration) {
        MethodBinding methodBinding = ((AbstractMethodDeclaration) referenceContext).binding;
        if (methodBinding != null) {
          buffer.append(methodBinding.computeUniqueKey(false/*not a leaf*/));
        }
 
View Full Code Here


        if (node == null) {
          if (this.binding instanceof LocalVariableBinding) {
            LocalVariableBinding localVariableBinding = (LocalVariableBinding) this.binding;
            BlockScope blockScope = localVariableBinding.declaringScope;
            if (blockScope != null) {
              ReferenceContext referenceContext = blockScope.referenceContext();
              if (referenceContext instanceof Initializer) {
                return null;
              }
              if (referenceContext instanceof AbstractMethodDeclaration) {
                return this.resolver.getMethodBinding(((AbstractMethodDeclaration) referenceContext).binding);
View Full Code Here

    char[] typeSig = this.binding.type.genericTypeSignature();
    JavaElement parent = null;
    IMethodBinding declaringMethod = getDeclaringMethod();
    final LocalVariableBinding localVariableBinding = (LocalVariableBinding) this.binding;
    if (declaringMethod == null) {
      ReferenceContext referenceContext = localVariableBinding.declaringScope.referenceContext();
      if (referenceContext instanceof TypeDeclaration){
        // Local variable is declared inside an initializer
        TypeDeclaration typeDeclaration = (TypeDeclaration) referenceContext;
        JavaElement typeHandle = null;
        typeHandle = Util.getUnresolvedJavaElement(
View Full Code Here

      if (method.modifiers == ClassFileConstants.AccDefault &&
          (method.annotations == null || method.annotations.length == 0)) {
        context.setTokenLocation(CompletionContext.TL_MEMBER_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

          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

      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 void completionOnMarkerAnnotationName(ASTNode astNode, Binding qualifiedBinding, Scope scope) {
    CompletionOnMarkerAnnotationName annot = (CompletionOnMarkerAnnotationName) astNode;

    // When completion is inside lambda body, the fake type cannot be attached to the lambda.
    ReferenceContext referenceContext = scope.parent.referenceContext();
    CompletionOnAnnotationOfType fakeType;
    if (referenceContext instanceof CompletionOnAnnotationOfType) {
      fakeType = (CompletionOnAnnotationOfType) referenceContext;
    } else {
      fakeType = new CompletionOnAnnotationOfType(CompletionParser.FAKE_TYPE_NAME, scope.referenceCompilationUnit().compilationResult, annot);
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) {  // LE is anonymous.
          MethodBinding binding = ((AbstractMethodDeclaration) referenceContext).binding;
          if (binding != null) {
            if (CharOperation.equals(binding.selector, method.selector)) {
              if (binding.areParameterErasuresEqual(method)) {
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.