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:
Vitalii Dmitriev 2018-02-13 23:12:24 +03:00 committed by GitHub
parent 77113c1a6d
commit f0c2d8a50c

View File

@ -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);
}
}
}