Examples of ReferenceContext


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

  */
  public final boolean isDefinedInMethod(MethodBinding method) {
    Scope scope = this;
    do {
      if (scope instanceof MethodScope) {
        ReferenceContext refContext = ((MethodScope) scope).referenceContext;
        if (refContext instanceof AbstractMethodDeclaration)
          if (((AbstractMethodDeclaration) refContext).binding == method)
            return true;
      }
      scope = scope.parent;
View Full Code Here

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

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

        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

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

    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

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

      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

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

          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

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

    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

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

            }
            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

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

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

 
  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
TOP
Copyright © 2018 www.massapi.com. 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.