Intellij does not trigger custom ArchiveFileSystem

Answered

I tried implementing ArchiveFileSystem, but it is never triggered by the system.

The goal is to be able to work with files from archivelib.abc the same way as with .jar dependencies.

Here's the dummy plugin project with dummy AbcFileSystem https://github.com/Katalune/AbcFileSystem

Here's test project which contains archivelib.abc as a dependency https://github.com/Katalune/Testandroidapp

What I need to change to make IDE to trigger AbcFileSystem and to ask for files in archivelib.abc archive? Is it a bug?

(this post is a follow-up to https://intellij-support.jetbrains.com/hc/en-us/community/posts/360010608279-Guidance-on-creating-custom-ArchiveFileSystem)

3 comments
Comment actions Permalink

1) do not use 'object' in https://github.com/Katalune/AbcFileSystem/blob/main/src/main/kotlin/com/github/katalune/abcfilesystem/AbcFileSystem.kt#L7, but 'class' -- see https://plugins.jetbrains.com/docs/intellij/kotlin.html#caution

It seems you have not registered '.abc' extension + provided custom FileType implementation yet (see com.intellij.ide.highlighter.ArchiveFileType as reference)

0
Comment actions Permalink

As suggested I

  • Added AbcFileSystem extending ArchiveFileSystem and registered it (overriden isCorrectFileType method)
  • Added AbcFileType and registered it
  • Made both AbcFileSystem and AbcFileType classed (not Kotlin objects)
  • Added AbcFileTypeOverrider and registered it (JIC, because the majority of examoles for FileType are for LanguageFileType, and I was not sure if it will work)

It did not resolve the issue. FileSystem is never triggered. Anything else I need to implement to tell IntelliJ to start indexing `some.abc` archive for files?

 

0
Comment actions Permalink

Not sure if anyone will follow-up on this question (since it is marked "answered"). Posted a new one here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/4402963580050-Intellij-does-not-trigger-custom-ArchiveFileSystem-FileType-added-

0

Please sign in to leave a comment.