Esempio n. 1
0
    private void processPropertyFromField(
        @NotNull GrField field, @NotNull GroovyResolveResult resolveResult) {
      if (field.getGetters().length != 0
          || field.getSetter() != null
          || !myPropertyNames.add(field.getName())
          || myIsMap) return;

      for (LookupElement element :
          GroovyCompletionUtil.createLookupElements(resolveResult, false, myMatcher, null)) {
        myConsumer.consume(
            ((LookupElementBuilder) element).withIcon(JetgroovyIcons.Groovy.Property));
      }
    }
Esempio n. 2
0
  private void processVariantsImpl() {
    processRefInAnnotationImpl();

    getVariantsImpl();
    final GroovyResolveResult[] candidates = myProcessor.getCandidates();
    List<LookupElement> results =
        GroovyCompletionUtil.getCompletionVariants(
            candidates,
            JavaClassNameCompletionContributor.AFTER_NEW.accepts(myRefExpr),
            myMatcher,
            myRefExpr);

    if (myProcessor.isEmpty() && results.isEmpty()) {
      results =
          GroovyCompletionUtil.getCompletionVariants(
              myProcessor.getInapplicableResults(),
              JavaClassNameCompletionContributor.AFTER_NEW.accepts(myRefExpr),
              myMatcher,
              myRefExpr);
    }
    for (LookupElement o : results) {
      myConsumer.consume(o);
    }
  }