0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00
vim/runtime/syntax/testdir/input/setup/java_module_info.vim
Aliaksei Budavei a9ae38dc3f
runtime(java): Recognise all available standard doclet tags
* Complement the tag set with @spec, {@systemProperty},
  {@summary}, @provides, @uses, @hidden, and {@index}.
* Do not hoard all tags under a single highlighting group.
* Skip over nested balanced braces in inline tags.
* Observe that tag names are case sensitive: both {@docRoot}
  and {@inheritDoc} are valid, whereas {@inheritdoc} and
  {@docroot} are not.
* In the @see tag arguments, allow for:
  - module name prefixes (e.g. java.base/java.lang.String);
  - references to arbitrary URI fragments (e.g. ##foo);
  - matching any tag variation arguments on the next line.
* Test directives and tags for Java module declarations.
* Enforce the word end for "module-info" candidates.

References:
https://bugs.openjdk.org/browse/JDK-8226279 (@spec)
https://bugs.openjdk.org/browse/JDK-8214559 ({@systemProperty})
https://bugs.openjdk.org/browse/JDK-8173425 ({@summary})
https://bugs.openjdk.org/browse/JDK-8160196 (@provides & @uses)
https://bugs.openjdk.org/browse/JDK-8073100 (@hidden)
https://bugs.openjdk.org/browse/JDK-8044243 ({@index})
https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html
https://github.com/openjdk/jdk/blob/jdk-21-ga/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java

closes: #15652

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-10 21:00:33 +02:00

31 lines
692 B
VimL

vim9script
# Test filenames are required to begin with the filetype name prefix,
# whereas the name of a Java module declaration must be "module-info".
const name_a: string = 'input/java_module_info.java'
const name_b: string = 'input/module-info.java'
def ChangeFilename()
exec 'saveas! ' .. name_b
enddef
def RestoreFilename()
exec 'saveas! ' .. name_a
delete(name_b)
enddef
autocmd_add([{
replace: true,
group: 'java_syntax_tests',
event: 'BufEnter',
pattern: name_a,
cmd: 'ChangeFilename()',
once: true,
}, {
group: 'java_syntax_tests',
event: ['BufLeave', 'ExitPre'],
pattern: name_b,
cmd: 'RestoreFilename()',
once: true,
}])