Package org.eclipse.dltk.ast.references

Examples of org.eclipse.dltk.ast.references.TypeReference


        } else {
          description = url;
        }
        link = String.format("<a href=\"%s\">%s</a>", url, description); //$NON-NLS-1$
      } else {
        link = handleLinks(Arrays.asList(new TypeReference(0, 0, url)))
            .toString();
      }
      replaceLinks.add(new ReplaceEdit(m.start(), m.end() - m.start(),
          link));
    }
View Full Code Here


    String refTypeName = null;
    String refMemberName = null;
    String[] refMethodParamTypes = null;
    if (fragment instanceof TypeReference) {
      TypeReference type = (TypeReference) fragment;
      String name = type.getName();

      int typeNameEnd = name.indexOf("::"); //$NON-NLS-1$
      if (typeNameEnd == -1) {
        refTypeName = name;
      } else {
View Full Code Here

          && phpDocTag.sourceEnd() >= end) {
        SimpleReference[] references = phpDocTag.getReferences();
        if (references != null) {
          for (SimpleReference simpleReference : references) {
            if (simpleReference instanceof TypeReference) {
              TypeReference typeReference = (TypeReference) simpleReference;
              if (typeReference.sourceStart() <= offset
                  && typeReference.sourceEnd() >= end) {
                String name = typeReference.getName();

                // remove additional end elements like '[]'
                if (typeReference.sourceEnd() > end) {
                  int startShift = offset
                      - typeReference.sourceStart();
                  name = typeReference.getName().substring(
                      startShift,
                      (end - offset) + startShift);
                }

                IType[] types = filterNS(PHPModelUtils
View Full Code Here

                && split[0].equals(variableReference.getName())) {
              List<IGoal> goals = new LinkedList<IGoal>();
              for (String name : split[1].split("\\|")) { //$NON-NLS-1$
                if (name.trim().length() > 0) {
                  goals.add(new ExpressionTypeGoal(context,
                      new TypeReference(
                          tag.sourceStart(), tag
                              .sourceEnd(), name
                              .trim())));
                }
              }
View Full Code Here

        int typeEnd = typeStart + typeName.length();
        if (typeName.length() > 0) {
          if (typeName.endsWith("[]")) {
            typeName = typeName.substring(0, typeName.length() - 2); //$NON-NLS-1$
          }
          typeReferences.add(new TypeReference(typeStart, typeEnd,
              typeName));
        }
        types = types.substring(pipeIdx + 1);
        typeStart += pipeIdx + 1;
        pipeIdx = types.indexOf('|'); //$NON-NLS-1$
      }
      String typeName = types;
      int typeEnd = typeStart + typeName.length();
      if (typeName.length() > 0) {
        if (typeName.endsWith("[]")) {
          typeName = typeName.substring(0, typeName.length() - 2); //$NON-NLS-1$
        }
        typeReferences.add(new TypeReference(typeStart, typeEnd,
            typeName));
      }

      VariableReference varReference = new VariableReference(varStart,
          varEnd, varName);
View Full Code Here

    StaticConstantAccess expr = (StaticConstantAccess) typedGoal
        .getExpression();

    Expression dispatcher = expr.getDispatcher();
    if (dispatcher instanceof TypeReference) {
      TypeReference typeReference = (TypeReference) dispatcher;
      return new IGoal[] { new ConstantDeclarationGoal(goal.getContext(),
          expr.getConstant().getName(), typeReference.getName()) };
    }
    return IGoal.NO_GOALS;
  }
View Full Code Here

        int classEnd = getClassEndIndex(word, classStart);
        List<TypeReference> types = new LinkedList<TypeReference>();

        while (classStart < classEnd) {
          String className = word.substring(classStart, classEnd);
          types.add(new TypeReference(valueStart + wordStart
              + classStart, valueStart + wordStart + classEnd,
              className));

          classStart = getClassStartIndex(word, classEnd);
          classEnd = getClassEndIndex(word, classStart);
        }
        if (types.size() > 0) {
          references = types.toArray(new TypeReference[types.size()]);
          referencesWithOrigOrder = references;
        }
      }
    } else if (tagKind == PARAM || tagKind == PROPERTY
        || tagKind == PROPERTY_READ || tagKind == PROPERTY_WRITE) {

      int firstWordStart = getNonWhitespaceIndex(value, 0);
      int firstWordEnd = getWhitespaceIndex(value, firstWordStart);
      if (firstWordStart < firstWordEnd) {

        int secondWordStart = getNonWhitespaceIndex(value, firstWordEnd);
        int secondWordEnd = getWhitespaceIndex(value, secondWordStart);
        if (secondWordStart < secondWordEnd) {

          String firstWord = value.substring(firstWordStart,
              firstWordEnd);
          String secondWord = value.substring(secondWordStart,
              secondWordEnd);
          if (firstWord.charAt(0) == '$') {
            references = new SimpleReference[2];
            references[0] = new VariableReference(valueStart
                + firstWordStart, valueStart + firstWordEnd,
                firstWord);
            references[1] = new TypeReference(valueStart
                + secondWordStart, valueStart + secondWordEnd,
                secondWord);
            referencesWithOrigOrder = references;
          } else if (secondWord.charAt(0) == '$') {
            references = new SimpleReference[2];
            references[0] = new VariableReference(valueStart
                + secondWordStart, valueStart + secondWordEnd,
                secondWord);
            references[1] = new TypeReference(valueStart
                + firstWordStart, valueStart + firstWordEnd,
                firstWord);
            referencesWithOrigOrder = new SimpleReference[2];
            referencesWithOrigOrder[0] = references[1];
            referencesWithOrigOrder[1] = references[0];
View Full Code Here

      Scalar scalar = (Scalar) expression;
      return new ScalarEvaluator(exprGoal, scalar);
    }
    if (expressionClass == TypeReference.class
        || expressionClass == FullyQualifiedReference.class) {
      TypeReference type = (TypeReference) expression;
      return new TypeReferenceEvaluator(exprGoal, type);
    }
    if (expressionClass == TraitAliasStatement.class) {
      TraitAliasStatement tas = (TraitAliasStatement) expression;
      if (tas.getAlias().getTraitMethod() instanceof FullyQualifiedTraitMethodReference) {
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.ast.references.TypeReference

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.