From f0c2d8a50cb09bbf8b04b507dfc7fbfca47fee34 Mon Sep 17 00:00:00 2001 From: Vitalii Dmitriev Date: Tue, 13 Feb 2018 23:12:24 +0300 Subject: [PATCH] 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! --- .../src/com/simpleplugin/SimpleFileTypeFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simple_language_plugin/src/com/simpleplugin/SimpleFileTypeFactory.java b/simple_language_plugin/src/com/simpleplugin/SimpleFileTypeFactory.java index f263e9602..9275dc2e3 100644 --- a/simple_language_plugin/src/com/simpleplugin/SimpleFileTypeFactory.java +++ b/simple_language_plugin/src/com/simpleplugin/SimpleFileTypeFactory.java @@ -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); } -} \ No newline at end of file +}