Make IntelliJ recognize files from archive of custom type

  • Situation: I have a project with a dependency on archive of custom type (``), which contains standard Java/Kotlin files, and nested zip/jar files.
  • Task: When using `Some` class in a project (this class is defined in one of files inside ``), make this class be recognizable by Intellij (suggest completion for it and lint errors).
  • Actions:
  1. Added AbcFileSystem extending ArchiveFileSystem and registered it.
  2. Added AbcFileType and registered it
  • Result: File from the custom archive is discovered via VF Manager with explicit URI
val url = "abc://" + project.basePath + "/app/libs/" + "!/Some.kt"

But the symbol `Some` is not recognized when editing project.

  • Question: I found 2 ways to make this file recognized, which one is recommended one?
  1. Implement `IndexedRootsProvider` (IIUC it will make IntelliJ index archives for containing files/classes)
  2. Implement `PsiElementFinder` (e.g. `NonClasspathClassFinder`, 
    IIUC it will suggest files to IntelliJ)

I saw suggestions on both in this forum and usages of both in OSS plugins. I hope someone, understanding how IntelliJ works holistically, can point me out what is the best direction to choose: IndexedRoot or ElementFinder?


Here's the dummy plugin project with dummy AbcFileSystem and AbcFileType: github

Here's test project which contains as a dependency: github

Previous discussion: forum


Here's what I mean by 

> the symbol `Some` is not recognized when editing project.


Please sign in to leave a comment.