Determine file type based on content

Is there a way to determine file type based on content?
I have a plugin were one file name can have two diffrent content types and I want to detect it's content and then assosiate it with a file type.
I've tried to look at fileTypeDetector extension point, but haven't found any documentation on it.

1 comment
Comment actions Permalink

Not sure about `fileTypeDetector` extension point, because it allows to determine file type for unrecognized files only.
This extension point gets called in `FileTypeManagerImpl.detectFromContentAndCache`:

Perhaps `com.intellij.psi.LanguageSubstitutor` extension point could help you.


Please sign in to leave a comment.