New FileType is ignored in most cases in InteliJ Plugin
已回答
I have created the following class
public class LineageFileType implements FileType {
@Override public @NonNls @NotNull String getName() {
return "Lineage File";
}
@Override public @NlsContexts.Label @NotNull String getDescription() {
return "YAML file with 'lineage' extension, which contains lineage description";
}
@Override public @NlsSafe @NotNull String getDefaultExtension() {
// return "lineage";
return ".lineage";
}
@Override public @Nullable Icon getIcon() {
return null;
}
@Override public boolean isBinary() {
return false;
}
}
and reigstered it within plugin.xml:
<extensions defaultExtensionNs="com.intellij">
<fileType name="Lineage File" implementationClass="my.package.LineageFileType"/>
</extensions>
Unfortunately, this type is тушерук shown in new file creation
nor it reacts on extension (lineage).
Simultaneously I can assign this type to existing file

How to make custom file type working in all cases?
请先登录再写评论。
Hej there,
might be due to missing extensions attribute on your fileType element.
Indeed, also other fields are required. See https://plugins.jetbrains.com/docs/intellij/registering-file-type.html and linked how-to with sample code https://plugins.jetbrains.com/docs/intellij/language-and-filetype.html#register-the-filetype