]> git.ipfire.org Git - thirdparty/vim.git/commit
runtime(java): Recognise the inline kind of the {@return} tag (#14284)
authorAliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
Mon, 25 Mar 2024 15:18:28 +0000 (18:18 +0300)
committerGitHub <noreply@github.com>
Mon, 25 Mar 2024 15:18:28 +0000 (16:18 +0100)
commit8e59a7ba88776d5425bafc6eefd978de3312fcdf
tree3fb25661f414faf3bb70f9b24e31b82260287ca5
parent4b715bdaf4ca08ba0f64475e250c0fe799ab6d9b
runtime(java): Recognise the inline kind of the {@return} tag (#14284)

Also:

- Refine comment matching (javaComment{Error\ and,Start}).
- Continue rewriting regexps (prefer atom grouping with
  non-capturing parens; factor out common prefixes in
  alternations).
- Allow for relative paths with the _file_ attribute of
  {@snippet}.
- Anticipate HTML in the @see tags.
- Match the nullary method parens in javaDocSeeTagParam.
- Improve the boundary patterns for summary sentences of
  documentation.

> This sentence ends at ... or at the first tag (as defined
> below).

There are Java documentation tags (@) and there are HTML
tags (<?>) (with Markdown looming large; see JEP 467).  With
block tags, e.g. @param, @return, @see, we begin another
documentation "sentence" whether or not the author has
terminated the summary sentence with a period; with
.<!-- -->, we may follow abbreviations, enumerations,
initials, (but instead consider @literal or &nbsp;) _within_
the summary sentence.  On the other hand, inline tags, e.g.
@code, @link, @literal, should not terminate the summary
sentence.

References:
https://bugs.openjdk.org/browse/JDK-8075778
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#firstsentence
https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/java.vim
runtime/syntax/testdir/dumps/java_comments_00.dump
runtime/syntax/testdir/dumps/java_comments_01.dump
runtime/syntax/testdir/dumps/java_comments_02.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/java_comments_03.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/java_comments_04.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/java_comments_99.dump
runtime/syntax/testdir/input/java_comments.java