The first step in developing a custom language plugin is registering a file type the language will be associated with. The IDE normally determines the type of a file by looking at its file name.

A custom language file type is a class derived from LanguageFileType, which passes a Language implementation class to its base class constructor. To register a file type, the plugin developer provides an implementation of the FileTypeFactory interface, which is registered via the com.intellij.fileTypeFactory platform extension point.

Example: LanguageFileType implementation in Properties language plugin

To verify that the file type is registered correctly, you can implement the LanguageFileType.getIcon() method and verify that the correct icon is displayed for files which have the extension(s) associated with your file type.

results matching ""

    No results matching ""