Examples of SearchMatch


Examples of com.google.dart.engine.search.SearchMatch

        SourceRange range = new SourceRange(location.getOffset(), location.getLength());
        // TODO(scheglov) IndexConstants.DYNAMIC for MatchQuality.NAME
        MatchQuality quality = MatchQuality.EXACT;
//          MatchQuality quality = element.getResource() != IndexConstants.DYNAMIC
//              ? MatchQuality.EXACT : MatchQuality.NAME;
        SearchMatch match = new SearchMatch(quality, matchKind, targetElement, range);
        match.setQualified(relationship == IndexConstants.IS_REFERENCED_BY_QUALIFIED
            || relationship == IndexConstants.IS_INVOKED_BY_QUALIFIED);
        listener.matchFound(match);
      }
      listener.searchComplete();
    }
View Full Code Here

Examples of org.eclipse.dltk.core.search.SearchMatch

    assertTrue(collector.results.size() >= offsets.size());
   
    for (Integer markerOffset : offsets) {
      boolean matchFound = false;
      for (Iterator<SearchMatch> iterator = collector.matches.iterator(); iterator.hasNext(); ) {
        SearchMatch match = iterator.next();
       
        ISourceModule matchModule = assertInstance(match.getElement(), IMember.class).getSourceModule();
        if(DeeSearchEngineTestUtils.getSourceModuleFQName(matchModule).equals("sampledefs_refs")) {
          if(match.getOffset() == markerOffset) {
            // This marker offset is accounted for
            matchFound = true;
            iterator.remove();
            break;
          }
View Full Code Here

Examples of org.eclipse.dltk.core.search.SearchMatch

    int level = SearchMatch.A_INACCURATE;
    if(accLevel == PatternLocator.ACCURATE_MATCH || accLevel == PatternLocator.ERASURE_MATCH) {
      level = SearchMatch.A_ACCURATE;
    }
   
    SearchMatch match = this.newDeclarationMatch(enclosingType, level, node.getOffset(), node.getLength());
    // TODO: create reference matches
    matches.add(match);
  }
View Full Code Here

Examples of org.eclipse.dltk.core.search.SearchMatch

      enclosingElement = createMethodHandle(method.getName());
    }
    if (accuracy > -1 && enclosingElement != null) { // skip if unable to
      // find method
      if (encloses(enclosingElement)) {
        SearchMatch match = null;
        if (DLTKCore.DEBUG) {
          System.out.println("TODO: AST Add constructor support."); //$NON-NLS-1$
        }
        match = this.patternLocator.newDeclarationMatch(method,
            enclosingElement, accuracy, this);
View Full Code Here

Examples of org.eclipse.dltk.core.search.SearchMatch

      throws CoreException {
    IModelElement enclosingElement = createHandle(method, parent);
    if (accuracy > -1 && enclosingElement != null) { // skip if unable to
      // find method
      if (encloses(enclosingElement)) {
        SearchMatch match = null;
        if (DLTKCore.DEBUG) {
          System.out.println("TODO: AST Add constructor support."); //$NON-NLS-1$
        }
        match = this.patternLocator.newDeclarationMatch(method,
            enclosingElement, accuracy, this);
View Full Code Here

Examples of org.eclipse.jdt.core.search.SearchMatch

    if (results != null && !results.isEmpty()){
     
      Set vals = new HashSet(results.size());
      Set checkedTypes = new HashSet();
      for (Iterator it = results.iterator();it.hasNext();){
        SearchMatch match = (SearchMatch)it.next();
        IType res = (IType)match.getElement();
        addValidSubClasses(res, vals, checkedTypes);         
      }
      return createPossibleValues(vals);
    }           
    return new ArrayList(0);
View Full Code Here

Examples of org.eclipse.jdt.core.search.SearchMatch

      // The compilation units needing to be altered mapped to the
      // appropriate search matches.
      final Map units = new HashMap();
      for (final Iterator it = this.matchToPurposeMap.keySet().iterator(); it
          .hasNext();) {
        final SearchMatch match = (SearchMatch) it.next();
        final IJavaElement element = (IJavaElement) match.getElement();
        final ICompilationUnit unit = Util.getIMember(element)
            .getCompilationUnit();
        if (unit != null) {
          Collection searchMatchCollection = (Collection) units
              .get(unit);
View Full Code Here

Examples of org.eclipse.jdt.core.search.SearchMatch

      IProgressMonitor monitor) throws CoreException {
    final ASTRewrite astRewrite = ASTRewrite.create(node.getAST());
    final ImportRewrite importRewrite = ImportRewrite.create(node, true);

    for (final Iterator it = matches.iterator(); it.hasNext();) {
      final SearchMatch match = (SearchMatch) it.next();
      if (match.getAccuracy() == SearchMatch.A_ACCURATE
          && !match.isInsideDocComment())
        if (this.matchToPurposeMap.get(match) == SearchMatchPurpose.ALTER_TYPE_DECLARATION
            || this.matchToPurposeMap.get(match) == SearchMatchPurpose.ALTER_NAMESPACE_PREFIX)
          this.rewriteDeclarationsAndNamespaces(node, match, status,
              astRewrite, importRewrite);
        else if (this.matchToPurposeMap.get(match) == SearchMatchPurpose.ALTER_INFIX_EXPRESSION)
View Full Code Here

Examples of org.eclipse.jdt.core.search.SearchMatch

        // Work around for bug 164121. Force match for formal
        // parameters.
        if (je.getElementType() == IJavaElement.LOCAL_VARIABLE) {
          final ISourceRange isr = ((ILocalVariable) je)
              .getNameRange();
          final SearchMatch match = new SearchMatch(je,
              SearchMatch.A_ACCURATE, isr.getOffset(), isr
                  .getLength(), SearchEngine
                  .getDefaultSearchParticipant(), je
                  .getResource());
          requestor.acceptSearchMatch(match);
View Full Code Here

Examples of org.eclipse.jdt.core.search.SearchMatch

    if(!(elem instanceof IMethod)) return;
    try {
      IMethod element = (IMethod) elem;
      if(element.exists() == false) return;
      ISourceRange range = element.getSourceRange();
      SearchMatch match = new SearchMatch(element, SearchMatch.A_ACCURATE, range.getOffset(), range.getLength(), null, null);
      requestor.acceptSearchMatch(match);
    } catch (CoreException e) {
      JavaDocActivator.getDefault().handleSystemError(e, this);
    }
  }
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.