Mercurial > vim
diff runtime/syntax/testdir/dumps/java_comments_html_00.dump @ 36217:f1600eda0b56
runtime(java): Recognise the CommonMark form (///) of Javadoc comments
Commit: https://github.com/vim/vim/commit/85f054aa3f0fb9530712d0897e3c8ba29946fad4
Author: Aliaksei Budavei <0x000c70@gmail.com>
Date: Mon Sep 30 19:40:04 2024 +0200
runtime(java): Recognise the CommonMark form (///) of Javadoc comments
Complement "g:java_ignore_javadoc" with "g:java_ignore_html"
and "g:java_ignore_markdown" to allow selectively disabling
the recognition of HTML and CommonMark respectively.
(Note that this is not a preview feature.)
======================== LIMITATION ========================
According to the syntactical details of JEP 467:
> Any leading whitespace and the three initial / characters
> are removed from each line.
>
> The lines are shifted left, by removing leading whitespace
> characters, until the non-blank line with the least
> leading whitespace has no remaining leading whitespace.
>
> Additional leading whitespace and any trailing whitespace
> in each line is preserved, because it may be significant.
the following example:
------------------------------------------------------------
/// A summary sentence.
/// A list:
/// - Item A.
/// - Item B.
///
/// Some code span, starting here `
/// 1 + 2 ` and ending at the previous \`.
------------------------------------------------------------
should be interpreted as if it were written thus:
------------------------------------------------------------
///A summary sentence.
/// A list:
/// - Item A.
/// - Item B.
///
/// Some code span, starting here `
/// 1 + 2 ` and ending at the previous \`.
------------------------------------------------------------
Since automatic line rewriting will not be pursued, parts of
such comments having significant whitespace may be ?wrongly?
highlighted. For convenience, a &fex function is defined to
?correct? it: g:javaformat#RemoveCommonMarkdownWhitespace()
(:help ft-java-plugin).
References:
https://openjdk.org/jeps/467
https://spec.commonmark.org/0.31.2
closes: #15740
Co-authored-by: Tim Pope <code@tpope.net>
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 30 Sep 2024 19:45:17 +0200 |
parents | runtime/syntax/testdir/dumps/java_comments_00.dump@a215c8752c30 |
children |
line wrap: on
line diff
copy from runtime/syntax/testdir/dumps/java_comments_00.dump copy to runtime/syntax/testdir/dumps/java_comments_html_00.dump --- a/runtime/syntax/testdir/dumps/java_comments_00.dump +++ b/runtime/syntax/testdir/dumps/java_comments_html_00.dump @@ -1,7 +1,7 @@ | +0#0000e05#a8a8a8255@1>/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |u|n|l|e|t|!| |g+0fd7ff255|:+0&#ffffff0|j|a|v|a|_|n|o|_|t|a|b|_|s|p|a|c|e|_|e|r@1|o|r| |g|:|j|a|v|a|_|i|g|n|o|r|e|_|j+0&#ffd7d7255|a|v|a|d|o|c| +0#0000000#ffffff0 | +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |u|n|l|e|t|!| |g+0fd7ff255|:+0&#ffffff0|j|a|v|a|_|n|o|_|t|r|a|i|l|_|s|p|a|c|e|_|e|r@1|o|r| +0#0000000&@20 | +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |[|g|:|j|a|v|a|_|s|p|a|c|e|_|e|r@1|o|r|s|,|g|:|j|a|v|a|_|c|o|m@1|e|n|t|_|s|t|r|i|n|g|s|]|=|[|1+0#e000002&|,+0#0000e05&|1+0#e000002&|]+0#0000e05&| +0#0000000& -| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 +| +0#0000e05#a8a8a8255@1|/+0&#ffffff0@1| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|j|a|v|a|_|i|g|n|o|r|e|_|m|a|r|k|d|o|w|n| |=| |1+0#e000002&| +0#0000000&@24 | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72 | +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72