Can't register FileEditorProvider that handles directories?

So I want to handle directories with extension `.mllt`. I already registered a `FileTypeFactory`, and now I'm trying to use a `FileEditorProvider`. I monitored the invocation `accept` calls, and it appears that IntelliJ simply ignores directories. That is, I can see `accept` calls when double clicking on an unknown file, but my example, `workspace.mllt`, is simply shown as a tree branch and double clicking in the project view shows the internals of that directory instead of attempting to find an editor.

Is there a way to solve this? You can imagine `workspace.mllt` to be something like a jar file, only that technically it is a directory.

So this is how it looks, and I have a crappy workaround by associating the editor with a dummy file called 'open':

 

and this is how it should be:

 

Thanks, ..h.h..

2 comments

Hanns, the following might help:


Subclass a com.intellij.ide.projectView.TreeStructureProvider and implement modify method that changes `PsiDirectoryNode` for the mllt folders to a `PsiDirectoryNode` subclass that responds to `canNavigate`, `canNavigateToSource` and `getNavigationItem`.

Register it as a `com.intellij.treeStructureProvider` point.

 

Your editor provider's 'accept' should be called then

1

Please sign in to leave a comment.