Package org.eclipse.dltk.internal.core

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


    ICompletionContext context = getContext();
    AbstractCompletionContext concreteContext = (AbstractCompletionContext) context;
    ISourceModule sourceModule = concreteContext.getSourceModule();
    String prefix = concreteContext.getPrefix();
    SourceRange replaceRange = getReplacementRange(concreteContext);
    boolean withoutSemicolon = concreteContext.getNextWord().trim()
        .equals(IPHPKeywordsInitializer.SEMICOLON_SUFFIX);
    Collection<KeywordData> keywordsList = PHPKeywords.getInstance(
        sourceModule.getScriptProject().getProject()).findByPrefix(
        prefix);
View Full Code Here


    if (!(context instanceof ClassDeclarationKeywordContext)) {
      return;
    }

    ClassDeclarationKeywordContext concreteContext = (ClassDeclarationKeywordContext) context;
    SourceRange replaceRange = getReplacementRange(concreteContext);
    String prefix = concreteContext.getPrefix();
    String statementText = concreteContext.getStatementText().toString();
    if (CodeAssistUtils.startsWithIgnoreCase(EXTENDS, prefix)
        && statementText.indexOf(EXTENDS_WITH_BLANK) < 0) {
      reporter.reportKeyword(EXTENDS, getSuffix(concreteContext),
View Full Code Here

    Declaration declaration = ASTUtils.findDeclarationAfterPHPdoc(moduleDeclaration, offset);
    if (declaration instanceof MethodDeclaration) {

      String prefix = abstractContext.getPrefix();
      SourceRange replaceRange = getReplacementRange(abstractContext);
      String suffix = ""; //$NON-NLS-1$

      List<Argument> arguments = ((MethodDeclaration) declaration).getArguments();
      for (Argument arg : arguments) {
        String argumentVar = arg.getName();
View Full Code Here

    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);
    }
View Full Code Here

    }

    NamespaceMemberContext concreteContext = (NamespaceMemberContext) context;
    String prefix = concreteContext.getPrefix();
    String suffix = getSuffix(concreteContext);
    SourceRange replaceRange = getReplacementRange(concreteContext);

    for (IType ns : concreteContext.getNamespaces()) {
      try {
        for (IMethod method : ns.getMethods()) {
          if (CodeAssistUtils.startsWithIgnoreCase(method.getElementName(), prefix)) {
View Full Code Here

    }

    NamespaceUseNameContext concreteContext = (NamespaceUseNameContext) 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 (IType[]) result.toArray(new IType[result.size()]);
  }

  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

    IDLTKSearchScope scope = createSearchScope();

    IMethod[] functions = PhpModelAccess.getDefault().findMethods(prefix,
        matchRule, Modifiers.AccGlobal, 0, scope, null);

    SourceRange replacementRange = getReplacementRange(abstractContext);
    String suffix = getSuffix(abstractContext);

    for (IMethod method : functions) {
      reporter.reportMethod(method, suffix, replacementRange);
    }
View Full Code Here

            scope, null);
        list.addAll(Arrays.asList(elements));
        elements = list.toArray(new IField[list.size()]);
      }

      SourceRange replaceRange = getReplacementRange(arrayContext);
      for (IModelElement element : elements) {
        IField field = (IField) element;
        try {
          ISourceRange sourceRange = field.getSourceRange();
          FakeField fakeField = new FakeField(
View Full Code Here

  protected void reportVariables(ICompletionReporter reporter,
      ArrayKeyContext context, String[] variables, String prefix,
      boolean removeDollar, int extraObject) 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

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.