Package org.eclipse.php.internal.core.util.text

Examples of org.eclipse.php.internal.core.util.text.TextSequence.subSequence()


    }
    if (wordStart < 0 || wordEnd < 0 || wordStart > wordEnd) {
      return ""; //$NON-NLS-1$
    }
    String previousWord = statementText.subSequence(wordStart, wordEnd)
        .toString();

    if (hasWhitespaceBeforeCursor()) {
      return previousWord;
    }
View Full Code Here


    wordStart = PHPTextSequenceUtilities.readIdentifierStartIndex(
        phpVersion, statementText, wordEnd, true);
    if (wordStart < 0 || wordEnd < 0 || wordStart > wordEnd) {
      return ""; //$NON-NLS-1$
    }
    previousWord = statementText.subSequence(wordStart, wordEnd).toString();

    return previousWord;
  }

  /**
 
View Full Code Here

    int statementLength = statementText.length();
    int prefixEnd = PHPTextSequenceUtilities.readBackwardSpaces(
        statementText, statementLength); // read whitespace
    int prefixStart = PHPTextSequenceUtilities.readIdentifierStartIndex(
        phpVersion, statementText, prefixEnd, true);
    return statementText.subSequence(prefixStart, prefixEnd).toString();
  }

  /**
   * Returns the end of the word on which code assist was invoked
   *
 
View Full Code Here

    int elementStart = getElementStart();
    int lhsIndex = elementStart - "$this".length() //$NON-NLS-1$
        - getTriggerType().getName().length();
    if (lhsIndex >= 0) {
      TextSequence statementText = getStatementText();
      String parentText = statementText.subSequence(lhsIndex,
          elementStart - getTriggerType().getName().length())
          .toString();
      if (parentText.equals("$this")) { //$NON-NLS-1$
        isThis = isDirectThis = true;
      }
View Full Code Here

    if (!isThis) {
      lhsIndex = elementStart - "$parent".length() //$NON-NLS-1$
          - getTriggerType().getName().length();
      if (lhsIndex >= 0) {
        TextSequence statementText = getStatementText();
        String parentText = statementText.subSequence(lhsIndex,
            elementStart - getTriggerType().getName().length())
            .toString();
        if (parentText.equals("$parent")) { //$NON-NLS-1$
          isParent = true;
        }
View Full Code Here

    if (elementStart < 1) { // there's no trigger of length less than 1
                // characters
      return false;
    }

    String triggerText = statementText.subSequence(elementStart - 1,
        elementStart).toString();
    if (!triggerText.equals("\\")) { //$NON-NLS-1$
      return false;
    }
View Full Code Here

    int endNamespace = PHPTextSequenceUtilities.readBackwardSpaces(
        statementText, elementStart - 1);
    int nsNameStart = PHPTextSequenceUtilities.readNamespaceStartIndex(
        statementText, endNamespace, false);
    String nsName = statementText.subSequence(nsNameStart, elementStart)
        .toString();
    if (nsName.indexOf('\\') < 0) {
      return false;
    }
    if (!nsName.startsWith("\\")) { //$NON-NLS-1$
View Full Code Here

    int statementLength = statementText.length();
    int prefixEnd = PHPTextSequenceUtilities.readBackwardSpaces(
        statementText, statementLength); // read whitespace
    int prefixStart = PHPTextSequenceUtilities.readIdentifierStartIndex(
        statementText, prefixEnd, true);
    return statementText.subSequence(prefixStart, prefixEnd).toString();
  }

  public int getPrefixEnd() throws BadLocationException {
    ITextRegion phpToken = getPHPToken();
    if (phpToken.getType() == PHPRegionTypes.PHP_NS_SEPARATOR) {
View Full Code Here

    if (elementStart <= 2) { // there's no trigger of length less than 2
      // characters
      return false;
    }

    String triggerText = statementText.subSequence(elementStart - 2,
        elementStart).toString();
    if (triggerText.equals("->")) { //$NON-NLS-1$
      triggerType = Trigger.OBJECT;
    } else if (triggerText.equals("::")) { //$NON-NLS-1$
      triggerType = Trigger.CLASS;
View Full Code Here

      tagEnd = PHPTextSequenceUtilities.readBackwardSpaces(statementText,
          tagEnd);
      tagStart = PHPTextSequenceUtilities.readIdentifierStartIndex(
          getPhpVersion(), getStatementText(), tagEnd, true);

      tagName = statementText.subSequence(tagStart, tagEnd).toString();

      if (tagStart > 0 && statementText.charAt(tagStart - 1) == '@') {
        found = true;
      } else if (isPHPTag(tagName)) {
        found = true;
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.