[javadoc] IDEA-285556 Support language injection into snippet

JEP-413 says that by default a snippet tag's body is in JAVA language, so JavadocInjector injects JAVA into a snippet tag automatically. The injector relies on the lang attribute to inject a language, if the attribute is not present, then JAVA is used.
In order to make a user's live easier the injector doesn't make user guess the correct language name, instead if the injector didn't find a language by the value from the `lang` attribute it traverses throughout all the registered languages and looks for the one the name of which matches the specified ignoring case. That is the case for java: in our code base the language goes by the `JAVA` id, but users tend to write the language name in lowercase ("java") or with only the first letter in the capital case ("Java")

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: cca8c90bb5ad04485f1bf4119b9936114e5492e4
This commit is contained in:
Nikita Eshkeev
2021-12-28 19:55:49 +03:00
committed by intellij-monorepo-bot
parent 6df3ee6111
commit 6ffd9bc4b6
10 changed files with 161 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
/** {<warning descr="'@snippet' tag is not available at this language level">@snippet</warning> :
* Body
* <error descr="'class' or 'interface' expected">Body</error>
* }
*/
class A {