Usually leading asterisks of a javadoc are aligned so the common indent for the lines in a snippet's body is obvious,
but nevertheless javadoc can have multiple leading asterisks, and they don't have to be aligned.
This patch fixes the indent stripping: if the indent is too short, which will result in leaving some leading
asterisks after stripping the indent from the line, the indent gets increased, so it goes after the last leading asterisk in the line.
GitOrigin-RevId: c79bcb3e25b96b5b1ff52da350f926673d155199
In order to make the fragment editor for injected languages for PsiSnippetDocTagImpl works this patch:
- Fixes the logic behind LiteralTextEscaper#decode for PsiSnippetDocTagImpl in order not to lose any whitespaces since they are a part of the snippet.
- Uses OldJavaInjectedFileChangesHandler for PsiSnippetDocTagImpl because it works without problems
- Does not invoke EnterBetweenBracesHandler#preprocessEnter for PsiSnippetDocTagImpl, because it inserts excessive leading asterisks
GitOrigin-RevId: 496e9b7a2cd788ff0a0d473b8032b531bdb1fbfc
Implement updating the content of a snippet tag with the help from a method implementer. A snippet might invoke overriding a method though a completion and when a parent method is inserted it might contain javadoc. In this case it's impossible to recreate a snippet tag because the new text for the tag contains "/**" and "*/" that come from the parent method's javadoc. The implemented method implementer helps to strip a method's javadoc if it's present.
Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>
GitOrigin-RevId: 42b315ed2670701e50574a383f0442df69accd35
Fix injection for empty snippets. The range to inject is now starts after the colon and ends when the body ends. If no colon exist, then use the whole body as an injection point.
GitOrigin-RevId: c7961f13c30212f52aad45a121bcf11b70ce8f2b
Add a enter handler for snippets to insert leading asterisks if needed.
Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>
GitOrigin-RevId: 365eaf0c873f11673dd03cbbb7b4395410e0e110
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
Make PsiSnippetDocTagImpl implement InjectionLanguageHost in order to make it possible to inject languages to the `@snippet` tag.
GitOrigin-RevId: d0afe885f098d5e33c5e6f3409bfaf88b76bedc0