add warning about file type factory deprecation and simplify registration content in simple language tutorial

This commit is contained in:
Karol Lewandowski 2022-07-27 13:04:50 +02:00
parent 1bb8e970e9
commit e00072f32d
2 changed files with 9 additions and 3 deletions

View File

@ -29,6 +29,10 @@ To associate the file type in the IDE, specify one or more associations as liste
<tab title="Pre-2019.2"> <tab title="Pre-2019.2">
> The FileType Factory approach is deprecated. Use it only when the plugin requires support for platform versions older than 2019.2.
>
{type="warning"}
To register a file type, the plugin developer provides a subclass of [`FileTypeFactory`](upsource:///platform/ide-core/src/com/intellij/openapi/fileTypes/FileTypeFactory.java), which is registered via the `com.intellij.fileTypeFactory` extension point. To register a file type, the plugin developer provides a subclass of [`FileTypeFactory`](upsource:///platform/ide-core/src/com/intellij/openapi/fileTypes/FileTypeFactory.java), which is registered via the `com.intellij.fileTypeFactory` extension point.
</tab> </tab>

View File

@ -48,9 +48,7 @@ The Simple Language file type is defined by subclassing [`LanguageFileType`](ups
<tab title="2019.2 and later"> <tab title="2019.2 and later">
Direct registration is possible - no `FileTypeFactory` is required. The Simple Language file type is registered via the `com.intellij.fileType` extension point in <path>plugin.xml</path> and registered with <path>*.simple</path> extension:
Instead, the file type is registered via the `com.intellij.fileType` extension point in <path>plugin.xml</path> and registered with <path>*.simple</path> extension:
```xml ```xml
<extensions defaultExtensionNs="com.intellij"> <extensions defaultExtensionNs="com.intellij">
@ -67,6 +65,10 @@ Instead, the file type is registered via the `com.intellij.fileType` extension p
<tab title="Pre-2019.2"> <tab title="Pre-2019.2">
> The FileType Factory approach is deprecated. Use it only when the plugin requires support for platform versions older than 2019.2.
>
{type="warning"}
### Define a FileType Factory ### Define a FileType Factory
First, define `SimpleFileTypeFactory` as a subclass of [`FileTypeFactory`](upsource:///platform/ide-core/src/com/intellij/openapi/fileTypes/FileTypeFactory.java). First, define `SimpleFileTypeFactory` as a subclass of [`FileTypeFactory`](upsource:///platform/ide-core/src/com/intellij/openapi/fileTypes/FileTypeFactory.java).