How to register new FileEditorProvider in system?

What I want to do is creating new editor for the file of special extension.
For that I need Intellij recognize this file when trying to open it in openFileImpl4() function.

FileEditorProviderManagerImpl class has only private methods of registering providers.


Many thanks in advance

3 comments
Comment actions Permalink

FileEditorProvider implementations are registered via Extension Point with name com.intellij.openapi.fileEditor.FileEditorProvider#EP_FILE_EDITOR_PROVIDER

See https://confluence.jetbrains.com/display/IDEADEV/IntelliJ+IDEA+Plugin+Structure

0
Comment actions Permalink

Am I right that you mean the following:

add to the plugin.xml file:

<extensionPoint name="fileEditorProvider"
                     interface="com.intellij.openapi.fileEditor.MyFileEditorProvider"/>


Or not?

Could you please prove a snippet of code?

0
Comment actions Permalink

There are many samples in IntelliJ Community Edition source code

for example, org.intellij.images.editor.impl.ImageFileEditorProvider which is registered in images/src/META-INF/ImagesPlugin.xml

0

Please sign in to leave a comment.