예제 #1
0
 public Collection<LookupElementAction> getActionsFor(LookupElement element) {
   final CollectConsumer<LookupElementAction> consumer =
       new CollectConsumer<LookupElementAction>();
   for (LookupActionProvider provider : LookupActionProvider.EP_NAME.getExtensions()) {
     provider.fillActions(element, this, consumer);
   }
   if (!consumer.getResult().isEmpty()) {
     consumer.consume(new ShowHideIntentionIconLookupAction());
   }
   return consumer.getResult();
 }
  private static boolean shouldHighlightAsUnresolved(
      @NotNull GrReferenceExpression referenceExpression) {
    if (GrHighlightUtil.isDeclarationAssignment(referenceExpression)) return false;

    GrExpression qualifier = referenceExpression.getQualifier();
    if (qualifier != null && qualifier.getType() == null && !isRefToPackage(qualifier))
      return false;

    if (qualifier != null
        && referenceExpression.getDotTokenType() == GroovyTokenTypes.mMEMBER_POINTER
        && referenceExpression.multiResolve(false).length > 0) {
      return false;
    }

    if (!GroovyUnresolvedHighlightFilter.shouldHighlight(referenceExpression)) return false;

    CollectConsumer<PomTarget> consumer = new CollectConsumer<PomTarget>();
    for (PomDeclarationSearcher searcher : PomDeclarationSearcher.EP_NAME.getExtensions()) {
      searcher.findDeclarationsAt(referenceExpression, 0, consumer);
      if (!consumer.getResult().isEmpty()) return false;
    }

    return true;
  }