19 Commits

Author SHA1 Message Date
Mathias Boulay
fef6778210 fix,test(jdoc): Stabilize spaces in test files
GitOrigin-RevId: 0c6b8c8ca44e90bdc80764b5fa1d8f2656762100
2024-09-17 16:28:17 +00:00
Mathias Boulay
d6d13853e6 feat(javadoc-handler): auto insert end of code fence
GitOrigin-RevId: 24c855a125c859bcc80f43c93a7d6c57ec9e3586
2024-09-17 16:28:17 +00:00
Mathias Boulay
027d4fb022 fix(javadoc-handler): insert leading tokens before start of comment
GitOrigin-RevId: 2fc351433f7841f9753d67e2a8d925a9991a1716
2024-09-17 16:28:17 +00:00
Mathias Boulay
e05667345c fix(javadoc): Missing character on new lines within snippets
#IDEA-358874 Fixed

GitOrigin-RevId: e03874f588e31c106d3a25518c05e0850b3fcd24
2024-09-17 16:28:17 +00:00
Mathias Boulay
d56883b763 fix(JavaDoc): formatter, inspections
GitOrigin-RevId: 77686401cbf38ea31e93311a608bac7472ccc73c
2024-08-26 10:42:10 +00:00
Mathias Boulay
f95cbb9677 fix(JavaDoc): better autocomplete
GitOrigin-RevId: 64cc8794d732cd08566413b0070b371768e47d8f
2024-08-19 10:39:25 +00:00
Mathias Boulay
abd7b1dded fix(JDoc): Formatting and inspections issues
GitOrigin-RevId: 910e9b3335fa7c3967fb79893ecba7c69595a201
2024-08-14 18:24:38 +00:00
Tagir Valeev
a69a85af47 [javadoc] PsiSnippetAttributeList#getAttribute; inject plain text for unknown lang attribute
GitOrigin-RevId: 014ed5a2388084a20c53c9ff506dd7f9c4a8d322
2023-03-10 14:17:04 +00:00
Anna Kozlova
d3f5e85260 [javadoc] [snippet] detect JShell language even if java is explicitly set (IDEA-290710)
java expects top level class but the examples would not contain that boilerplate code

GitOrigin-RevId: 8d047d989de2b836380d1523f98c0bd142b9c9cf
2022-03-18 19:21:26 +00:00
Anna Kozlova
c7328bb1a2 [java] [javadoc snippet] fix injection with unclear context
use existing JShell wrappers

GitOrigin-RevId: 2e0351145e1e3f750d781cd62bcda20cc49693c7
2022-02-15 13:14:40 +00:00
Nikita Eshkeev
fd0a6dfb94 [javadoc] IDEA-285556 Support language injection into snippet
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
2022-02-10 21:11:41 +00:00
Nikita Eshkeev
b993d39371 [javadoc] IDEA-285556 Support language injection into snippet
Split the snippet body into small chunks for injection

GitOrigin-RevId: d4bf9d22521a0b418c1fab4e1de4c0ada3e6677d
2022-02-08 05:33:51 +00:00
Nikita Eshkeev
95259a2d22 [javadoc] IDEA-285556 Support language injection into snippet
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
2022-01-28 22:17:41 +00:00
Roman Ivanov
e28921c87e [java] fix snippet testData
GitOrigin-RevId: 495ab4073abc7adbac15db9bb5b71a9c505b1eae
2022-01-27 01:18:29 +00:00
Nikita Eshkeev
436eee6cf4 [javadoc] IDEA-285556 Support language injection into snippet
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
2022-01-20 02:16:47 +00:00
Nikita Eshkeev
715e914e30 [javadoc] IDEA-285556 Support language injection into snippet
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
2022-01-20 02:16:46 +00:00
Nikita Eshkeev
95e53ac831 [javadoc] IDEA-285556 Support language injection into snippet
Add a enter handler for snippets to insert leading asterisks if needed.

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

GitOrigin-RevId: 365eaf0c873f11673dd03cbbb7b4395410e0e110
2022-01-01 16:30:04 +00:00
Nikita Eshkeev
6ffd9bc4b6 [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
2021-12-28 19:34:50 +00:00
Nikita Eshkeev
41ddd38df5 [javadoc] IDEA-285556 Support language injection into snippet
Make PsiSnippetDocTagImpl implement InjectionLanguageHost in order to make it possible to inject languages to the `@snippet` tag.

GitOrigin-RevId: d0afe885f098d5e33c5e6f3409bfaf88b76bedc0
2021-12-23 06:09:34 +00:00