コード例 #1
0
ファイル: JetStubsTest.java プロジェクト: Hilzu/kotlin
 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");
 }
コード例 #2
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);
  }