示例#1
0
 @Override
 public void indexFunction(PsiJetFunctionStub stub, IndexSink sink) {
   String name = stub.getName();
   if (name != null) {
     if (stub.isTopLevel()) {
       // Collection only top level functions as only they are expected in completion without
       // explicit import
       if (!stub.isExtension()) {
         sink.occurrence(JetIndexKeys.TOP_LEVEL_FUNCTION_SHORT_NAME_KEY, name);
         // sink.occurrence(JetIndexKeys.TOP_LEVEL_FUNCTION_FQNAME_KEY, name);
       } else {
         sink.occurrence(JetIndexKeys.EXTENSION_FUNCTION_SHORT_NAME_KEY, name);
         // sink.occurrence(JetIndexKeys.EXTENSION_FUNCTION_FQNAME_KEY, name);
       }
     }
   }
 }
示例#2
0
  @Override
  public void indexFunction(PsiJetFunctionStub stub, IndexSink sink) {
    String name = stub.getName();
    if (name != null) {
      if (stub.isTopLevel()) {
        // Collection only top level functions as only they are expected in completion without
        // explicit import
        if (!stub.isExtension()) {
          sink.occurrence(JetShortFunctionNameIndex.getInstance().getKey(), name);
        } else {
          sink.occurrence(JetExtensionFunctionNameIndex.getInstance().getKey(), name);
        }

        FqName topFQName = stub.getTopFQName();
        if (topFQName != null) {
          sink.occurrence(
              JetTopLevelFunctionsFqnNameIndex.getInstance().getKey(), topFQName.getFqName());
        }
      }

      sink.occurrence(JetAllShortFunctionNameIndex.getInstance().getKey(), name);
    }
  }