9 Commits

Author SHA1 Message Date
Vitalii Dmitriev
f0c2d8a50c 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!
2018-02-13 23:12:24 +03:00
Matt Ellis
825956dde6 Update custom language tutorial 2017-10-12 12:11:42 +01:00
Ian Lesperance
78fc8cfd63 Explicitly depend on SimpleLanguage.INSTANCE (#34)
The use of `Language.findInstance()` implicitly depended on the fact that
`SimpleLanguage.INSTANCE` was referenced at some earlier point in time. In this
case, that happens because the instantiation of `SimpleParserDefinition`
triggers the instantiation of `COMMENTS`, which relies on
`SimpleTypes.COMMENT`.

When basing one's work on this sample project, however, one may run into
issues. Specifically, the absence of a custom comment token type will mean a
failure to correctly instantiate the singleton language object. Making the
dependence on `SimpleLanguage.INSTANCE` explicit prevents that issue from
occurring.
2017-02-16 00:12:29 +03:00
cheptsov
6bcf8623e5 IJSDK-203 Confusing grammar and no info on comments and whitespaces 2016-11-03 16:45:34 +01:00
cheptsov
e3943a8d71 IJSDK-203 Confusing grammar and no info on comments and whitespaces 2016-11-03 13:23:01 +01:00
Yann Cébron
189fa4c03b IJSDK-76 Optimize screenshot file sizes 2016-10-27 10:46:40 +02:00
Breandan Considine
89638a3694 Prefer wildcard imports to maximize vertical visibility in code samples
Too bad there isn't a way to filter lines with Jekyll Liquid tags
2016-03-21 16:59:17 -04:00
Breandan Considine
7b03fa6f39 Tidy up code samples and wrap at 80 chars #IJSDK-24 2016-03-21 16:08:47 -04:00
breandan considine
e2e94dadb4 First build for GH pages 2016-01-14 19:38:06 -08:00