Package org.eclipse.php.internal.core.codeassist.contexts

Examples of org.eclipse.php.internal.core.codeassist.contexts.MethodNameContext


    ICompletionContext context = getContext();
    if (!(context instanceof MethodNameContext)) {
      return;
    }

    MethodNameContext concreteContext = (MethodNameContext) context;
    CompletionRequestor requestor = concreteContext
        .getCompletionRequestor();

    String prefix = concreteContext.getPrefix();
    boolean exactName = requestor.isContextInformationMode();
    IType declaringClass = concreteContext.getDeclaringClass();

    String suffix = getSuffix(concreteContext);
    SourceRange replaceRange = null;
    if (suffix.equals("")) { //$NON-NLS-1$
      replaceRange = getReplacementRange(concreteContext);
    } else {
      replaceRange = getReplacementRangeWithBraces(concreteContext);
    }

    try {
      ITypeHierarchy hierarchy = getCompanion().getSuperTypeHierarchy(
          declaringClass, null);
      IMethod[] superClassMethods = PHPModelUtils
          .getSuperTypeHierarchyMethod(declaringClass, hierarchy,
              prefix, exactName, null);
      for (IMethod superMethod : superClassMethods) {
        if (declaringClass.getMethod(superMethod.getElementName())
            .exists()) {
          continue;
        }
        int flags = superMethod.getFlags();
        if (!PHPFlags.isFinal(flags) && !PHPFlags.isPrivate(flags)
            && !PHPFlags.isStatic(flags)) {
          reporter.reportMethod(superMethod, CONSTRUCTOR_SUFFIX,
              replaceRange);
        }
      }
    } catch (CoreException e) {
      PHPCorePlugin.log(e);
    }

    PHPVersion phpVersion = concreteContext.getPhpVersion();

    // Add magic methods:
    Set<String> functions = new TreeSet<String>();
    functions.addAll(Arrays.asList(PHPMagicMethods.getMethods(phpVersion)));
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.codeassist.contexts.MethodNameContext

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.