Esempio n. 1
0
 public void testClassIsTrait() {
   PsiFile psiFile = myFixture.configureByText("foo.kt", "trait Test { }");
   final List<JetDeclaration> declarations = ((JetFile) psiFile).getDeclarations();
   final JetClass jetClass = (JetClass) declarations.get(0);
   final PsiJetClassStub stub = JetStubElementTypes.CLASS.createStub(jetClass, null);
   assertEquals(true, stub.isTrait());
 }
Esempio n. 2
0
 public void testSuperclassNames() {
   final PsiFile psiFile =
       myFixture.configureByText(
           "foo.kt", "import java.util.ArrayList as alist\nclass C(): alist() { }");
   final List<JetDeclaration> declarations = ((JetFile) psiFile).getDeclarations();
   final JetClass jetClass = (JetClass) declarations.get(0);
   final PsiJetClassStub stub = JetStubElementTypes.CLASS.createStub(jetClass, null);
   final List<String> names = stub.getSuperNames();
   assertSameElements(names, "ArrayList", "alist");
 }
Esempio n. 3
0
  @Override
  public void indexClass(PsiJetClassStub stub, IndexSink sink) {
    String name = stub.getName();
    if (name != null) {
      sink.occurrence(JetIndexKeys.SHORT_NAME_KEY, name);
    }

    String fqn = stub.getQualifiedName();
    if (fqn != null) {
      sink.occurrence(JetIndexKeys.FQN_KEY, fqn);
    }
  }
Esempio n. 4
0
  @Override
  public void indexClass(PsiJetClassStub stub, IndexSink sink) {
    String name = stub.getName();
    if (name != null) {
      sink.occurrence(JetShortClassNameIndex.getInstance().getKey(), name);
    }

    String fqn = stub.getQualifiedName();
    if (fqn != null) {
      sink.occurrence(JetFullClassNameIndex.getInstance().getKey(), fqn);
    }

    for (String superName : stub.getSuperNames()) {
      sink.occurrence(JetSuperClassIndex.getInstance().getKey(), superName);
    }

    recordClassOrObjectByPackage(stub, sink);
  }