mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-27 16:57:49 +08:00
Remove passing a file extension explicitly.
Hello! In this code, the `SimpleFileType` instance passed as the first argument and the `"simple"` file extension as the second parameter. As far as I can see in FileTypeManagerImpl:263: ```java @Override public void consume(@NotNull FileType fileType) { register(fileType, parse(fileType.getDefaultExtension())); } ``` There is no need to declare it explicitly as it is taken by calling `SimpleFileType.#getDefaultExtension()` by default, so this parameter is redundant. To make tutorial more simple, I suggest this removal: seeing the second parameter is a bit confusing when we're passing the same value, returned from `getDefaultExtension()`. Since the tutorial shows the basics, not a flexibility of an API, the parameter can be removed. Thanks!
This commit is contained in:
parent
77113c1a6d
commit
f0c2d8a50c
@ -6,6 +6,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class SimpleFileTypeFactory extends FileTypeFactory {
|
||||
@Override
|
||||
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
|
||||
fileTypeConsumer.consume(SimpleFileType.INSTANCE, "simple");
|
||||
fileTypeConsumer.consume(SimpleFileType.INSTANCE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user