Registering a File Type
The first step in developing a custom language plugin is registering a file type associated with the language.
The IDE typically determines the type of a file by looking at its filename or extension.
When targeting 2019.2 or later only, use
com.intellij.fileType extension point to register
LanguageFileType implementation and instance via
fieldName attributes. Also,
language must be declared matching
FileType.getName() and ID of language returned from
To associate the file type in the IDE, specify one or more associations as listed in the following table.
Semicolon-separated list of extensions, without
Hard coded file name(s)
Semicolon-separated list of exact (case-insensitive) file names
Semicolon-separated list of patterns (
Semicolon-separated list of hash bang patterns
To register a file type, the plugin developer provides a subclass of
FileTypeFactory, which is registered via the
com.intellij.fileTypeFactory extension point.
To verify that the file type is registered correctly, you can implement the
LanguageFileType.getIcon() method and verify that the correct icon (see Working with Icons) is displayed for files associated with your file type.
If you want IDEs to show a hint prompting users that your plugin supports a specific file type, see Plugin Recommendations.
To control file type association with the IDE in the operating system, implement