Package org.eclipse.dltk.internal.core

Examples of org.eclipse.dltk.internal.core.SourceRange


        node = rootNode;
      }
      GotoStatementVisitor vistor = new GotoStatementVisitor(node, prefix);
      node.traverse(vistor);
      List<String> getoLabels = vistor.getGotoLabels();
      SourceRange range = getReplacementRange(context);
      for (String label : getoLabels) {
        reporter.reportKeyword(label, "", range); //$NON-NLS-1$
      }
    } catch (Exception e) {
    }
View Full Code Here


    if (start + length < prefixEnd) {
      length = prefixEnd - start;
    }

    SourceRange replacementRange = new SourceRange(start, length);
    return replacementRange;
  }
View Full Code Here

          && document.getChar(endOfReplacement + 1) == ')') {
        endOfReplacement += 2;
      }
    }

    SourceRange replacementRange = new SourceRange(start, endOfReplacement
        - start);
    return replacementRange;
  }
View Full Code Here

          prefix);
    }
    // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=310383
    enclosingTypeConstants = filterClassConstants(enclosingTypeConstants);
    // workaround end
    SourceRange replaceRange = getReplacementRange(abstractContext);
    for (IModelElement constant : enclosingTypeConstants) {
      reporter.reportField((IField) constant, "", replaceRange, false); //$NON-NLS-1$
    }

  }
View Full Code Here

    }

    NamespacePHPDocVarStartContext concreteContext = (NamespacePHPDocVarStartContext) context;
    // now we compute type suffix in PHPCompletionProposalCollector
    String suffix = "";//$NON-NLS-1$
    SourceRange replaceRange = getReplacementRange(concreteContext);

    for (IType type : getTypes(concreteContext)) {
      reporter.reportType(type, suffix, replaceRange, getExtraInfo());
    }
  }
View Full Code Here

    return result;
  }

  public SourceRange getReplacementRange(ICompletionContext context)
      throws BadLocationException {
    SourceRange replacementRange = super.getReplacementRange(context);
    if (replacementRange.getLength() > 0) {
      return new SourceRange(replacementRange.getOffset(),
          replacementRange.getLength() - 1);
    }
    return replacementRange;
  }
View Full Code Here

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

    SourceRange replaceRange = getReplacementRange(context);
    ArrayKeyContext arrayContext = (ArrayKeyContext) context;
    boolean endsWithQuota = arrayContext.getNextChar() == '\''
        || arrayContext.getNextChar() == '\"';
    if (arrayContext.hasQuotes() && !(endsWithQuota)) {
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=401766
      replaceRange = new SourceRange(replaceRange.getOffset(),
          replaceRange.getLength() + 1);
    }
    CompletionRequestor requestor = arrayContext.getCompletionRequestor();

    String prefix = arrayContext.getPrefix();
    ModuleDeclaration moduleDeclaration = SourceParserUtil
View Full Code Here

  protected void reportVariables(ICompletionReporter reporter,
      ArrayKeyContext context, String[] variables, String prefix,
      boolean removeDollar) throws BadLocationException {
    CompletionRequestor requestor = context.getCompletionRequestor();
    SourceRange replaceRange = getReplacementRange(context);
    for (String variable : variables) {
      if (removeDollar) {
        variable = variable.substring(1);
      }
      if (variable.startsWith(prefix)) {
View Full Code Here

    String prefix = concreteContext.getPrefix();
    boolean isParentCall = isParentCall(concreteContext);
    String suffix = getSuffix(concreteContext);

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

  public void apply(ICompletionReporter reporter) throws BadLocationException {

    ICompletionContext context = getContext();
    AbstractCompletionContext abstractContext = (AbstractCompletionContext) context;
    SourceRange replacementRange = getReplacementRange(abstractContext);

    IType[] types = getTypes(abstractContext);

    for (IType type : types) {
      reporter.reportType(type, "", replacementRange); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.internal.core.SourceRange

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.