0
0
mirror of https://github.com/vim/vim.git synced 2025-10-22 08:34:29 -04:00
Files
vim/runtime/syntax/testdir/input/setup/java_module_info.vim
Aliaksei Budavei 91ac18cb03 runtime(java): Recognise _module_ import declarations
After two preview proposals (JEPs 476 and 494), _module_
import declarations are now a part of the language (JDK 25).

Reference:
https://openjdk.org/jeps/511

closes: #18424

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-28 17:40:29 +00: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,
}])