From 50423ab8086c6e51b86548de77d79db8542ae317 Mon Sep 17 00:00:00 2001 From: Aliaksei Budavei <0x000c70@gmail.com> Date: Fri, 20 Sep 2024 21:37:46 +0200 Subject: [PATCH 1/5] runtime(java): Optionally recognise _module_ import declarations Define "g:java_syntax_previews" and include number 476 in its list to enable this recognition: ------------------------------------------------------------ let g:java_syntax_previews = [476] ------------------------------------------------------------ Reference: https://openjdk.org/jeps/476 closes: #15709 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt --- runtime/doc/syntax.txt | 5 +++-- runtime/syntax/java.vim | 9 ++++++++- runtime/syntax/testdir/dumps/java_module_info_00.dump | 4 ++-- runtime/syntax/testdir/dumps/java_module_info_01.dump | 2 +- runtime/syntax/testdir/input/java_module_info.java | 4 ++-- runtime/syntax/testdir/input/setup/java_module_info.vim | 2 ++ 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 01aa92a53276c..4a5b07c902aa2 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 9.1. Last change: 2024 Sep 18 +*syntax.txt* For Vim version 9.1. Last change: 2024 Sep 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2176,11 +2176,12 @@ cycles for such a feature to become either integrated into the platform or withdrawn from this effort. To cater for early adopters, there is optional support in Vim for syntax related preview features that are implemented. You can request it by specifying a list of preview feature numbers as follows: > - :let g:java_syntax_previews = [455] + :let g:java_syntax_previews = [455, 476] The supported JEP numbers are to be drawn from this table: `430`: String Templates [JDK 21] `455`: Primitive types in Patterns, instanceof, and switch + `476`: Module Import Declarations Note that as soon as the particular preview feature will have been integrated into the Java platform, its entry will be removed from the table and related diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index bbef266c34eac..800faa40a0418 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -3,7 +3,7 @@ " Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com> " Former Maintainer: Claudio Fleiner " Repository: https://github.com/zzzyxwvut/java-vim.git -" Last Change: 2024 Sep 18 +" Last Change: 2024 Sep 19 " Please check :help java.vim for comments on some of the options available. @@ -92,6 +92,13 @@ syn keyword javaTypedef this super syn keyword javaOperator new instanceof syn match javaOperator "\\%(\s*(\)\@!" +if s:ff.IsRequestedPreviewFeature(476) + " Module imports can be used in any source file. + syn match javaExternal "\" contains=javaModuleImport + syn keyword javaModuleImport contained module + hi def link javaModuleImport Statement +endif + " Since the yield statement, which could take a parenthesised operand, " and _qualified_ yield methods get along within the switch block " (JLS-17, ยง3.8), it seems futile to make a region definition for this diff --git a/runtime/syntax/testdir/dumps/java_module_info_00.dump b/runtime/syntax/testdir/dumps/java_module_info_00.dump index a80da8932fed8..82ef0b2cf0550 100644 --- a/runtime/syntax/testdir/dumps/java_module_info_00.dump +++ b/runtime/syntax/testdir/dumps/java_module_info_00.dump @@ -1,6 +1,6 @@ >/+0#0000e05#ffffff0@1| |T|h|i|s| |m|o|d|u|l|e| |d|e|c|l|a|r|a|t|i|o|n| |b|e|l|o|n|g|s| |t|o| |t|h|e| |s|a|m|p|l|e| |p|r|o|j|e|c|t| |p|u|b|l|i|s|h|e|d| |a|t| +0#0000000&@5 |/+0#0000e05&@1| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|z@2|y|x|w|v|u|t|/|m|o|d|u|l|e|-|i|n|f|o|.|g|i|t| |.| +0#0000000&@25 -@75 +|i+0#e000e06&|m|p|o|r|t| |m+0#af5f00255&|o|d|u|l|e| +0#0000000&|j|a|v|a|.|b|a|s|e|;| @50 |i+0#e000e06&|m|p|o|r|t| +0#0000000&|j|a|v|a|.|u|t|i|l|.|S|e|r|v|i|c|e|L|o|a|d|e|r|;| @43 @75 |/+0#0000e05&|*@1| +0#0000000&@71 @@ -12,7 +12,7 @@ | +0#0000e05&|*| |@+0#e000e06&|p|r|o|v|i|d|e|s| |o+0#00e0e07&|r|g|.|d|e|m|o|.|i|n|t|e|r|n|a|l|.|T|e|s|t|a|b|l|e| +0#0000000&@35 | +0#0000e05&|*| |@+0#e000e06&|s|e@1| +0#0000e05&|S+0#00e0e07&|e|r|v|i|c|e|L|o|a|d|e|r| +0#0000000&@53 | +0#0000e05&|*|/| +0#0000000&@71 -|m+0#00e0003&|o|d|u|l|e| +0#0000000&|o|r|g|.|m+0#00e0003&|o|d|u|l|e|.+0#0000000&|i|n|f|o|.|d|e|m|o| @47 +|m+0#00e0003&|o|d|u|l|e| +0#0000000&|o|r|g|.|m+0#00e0003&|o|d|u|l|e|.+0#0000000&|i|n|f|o|.|d|e|m|o| |/+0#0000e05&@1| |J|D|K| |2|3|+| |(|-@1|e|n|a|b|l|e|-|p|r|e|v|i|e|w| |-@1|r|e|l|e|a|s|e| |2|3|)|.| +0#0000000&@3 |{| @73 @4|r+0#af5f00255&|e|q|u|i|r|e|s| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|j|d|k|.|j|f|r|;| @46 @4|r+0#af5f00255&|e|q|u|i|r|e|s| +0#0000000&|j|a|v|a|.|b|a|s|e|;| @51 diff --git a/runtime/syntax/testdir/dumps/java_module_info_01.dump b/runtime/syntax/testdir/dumps/java_module_info_01.dump index 793cb89336f99..039b16f4bfc7f 100644 --- a/runtime/syntax/testdir/dumps/java_module_info_01.dump +++ b/runtime/syntax/testdir/dumps/java_module_info_01.dump @@ -1,5 +1,5 @@ | +0#0000e05#ffffff0|*|/| +0#0000000&@71 -|m+0#00e0003&|o|d|u|l|e| +0#0000000&|o|r|g|.|m+0#00e0003&|o|d|u|l|e|.+0#0000000&|i|n|f|o|.|d|e|m|o| @47 +|m+0#00e0003&|o|d|u|l|e| +0#0000000&|o|r|g|.|m+0#00e0003&|o|d|u|l|e|.+0#0000000&|i|n|f|o|.|d|e|m|o| |/+0#0000e05&@1| |J|D|K| |2|3|+| |(|-@1|e|n|a|b|l|e|-|p|r|e|v|i|e|w| |-@1|r|e|l|e|a|s|e| |2|3|)|.| +0#0000000&@3 |{| @73 @4|r+0#af5f00255&|e|q|u|i|r|e|s| +0#0000000&|s+0#00e0003&|t|a|t|i|c| +0#0000000&|j|d|k|.|j|f|r|;| @46 @4|r+0#af5f00255&|e|q|u|i|r|e|s| +0#0000000&|j|a|v|a|.|b|a|s|e|;| @51 diff --git a/runtime/syntax/testdir/input/java_module_info.java b/runtime/syntax/testdir/input/java_module_info.java index bfbea93a2e364..0fe49efecd267 100644 --- a/runtime/syntax/testdir/input/java_module_info.java +++ b/runtime/syntax/testdir/input/java_module_info.java @@ -1,6 +1,6 @@ // This module declaration belongs to the sample project published at // https://github.com/zzzyxwvut/module-info.git . - +import module java.base; import java.util.ServiceLoader; /** @@ -12,7 +12,7 @@ * @provides org.demo.internal.Testable * @see ServiceLoader */ -module org.module.info.demo +module org.module.info.demo // JDK 23+ (--enable-preview --release 23). { requires static jdk.jfr; requires java.base; diff --git a/runtime/syntax/testdir/input/setup/java_module_info.vim b/runtime/syntax/testdir/input/setup/java_module_info.vim index 2711c1a9a0609..b7b818f822825 100644 --- a/runtime/syntax/testdir/input/setup/java_module_info.vim +++ b/runtime/syntax/testdir/input/setup/java_module_info.vim @@ -28,3 +28,5 @@ autocmd_add([{ cmd: 'RestoreFilename()', once: true, }]) + +g:java_syntax_previews = [476] From 597aadcf214cd13bf6a2155bf45173edc03199de Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Fri, 20 Sep 2024 21:41:17 +0200 Subject: [PATCH 2/5] runtime(lyrics): support multiple timestamps in syntax script Problem: Multiple timestamps in the same line were not highlighted Solution: Adapt the syntax to support multiple timestamps fixes: #15703 closes: #15707 Signed-off-by: ObserverOfTime Signed-off-by: Christian Brabandt --- runtime/syntax/lyrics.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/syntax/lyrics.vim b/runtime/syntax/lyrics.vim index 42a288b51b1bc..fd127988f2dc6 100644 --- a/runtime/syntax/lyrics.vim +++ b/runtime/syntax/lyrics.vim @@ -2,7 +2,7 @@ " Language: LyRiCs " Maintainer: ObserverOfTime " Filenames: *.lrc -" Last Change: 2022 Sep 18 +" Last Change: 2024 Sep 20 if exists('b:current_syntax') finish @@ -23,7 +23,7 @@ syn match lrcTagName contained nextgroup=lrcTagValue syn match lrcTagValue /:\zs.\+\ze\]/ contained " Lyrics -syn match lrcLyricTime /^\s*\[\d\d:\d\d\.\d\d\]/ +syn match lrcLyricTime /^\s*\(\[\d\d:\d\d\.\d\d\]\)\+/ \ contains=lrcNumber nextgroup=lrcLyricLine syn match lrcLyricLine /.*$/ contained contains=lrcWordTime,@Spell syn match lrcWordTime /<\d\d:\d\d\.\d\d>/ contained contains=lrcNumber,@NoSpell From 87b65652e806ed5ae999f8b1f46b9306d48c9326 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 20 Sep 2024 21:47:19 +0200 Subject: [PATCH 3/5] runtime(modconf): remove erroneous :endif in ftplugin regression introduced in f86568f91848ece0c5da closes: #15704 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- runtime/ftplugin/modconf.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/ftplugin/modconf.vim b/runtime/ftplugin/modconf.vim index df1c787e709fc..68ce69a446ff8 100644 --- a/runtime/ftplugin/modconf.vim +++ b/runtime/ftplugin/modconf.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: modules.conf(5) configuration file +" Maintainer: This runtime file is looking for a new maintainer. " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2024-09-19 (simplify keywordprg #15696) +" Latest Revision: 2024-09-20 (remove erroneous endif) if exists("b:did_ftplugin") finish @@ -23,7 +24,6 @@ if has('unix') && executable('less') && exists(':terminal') == 2 setlocal keywordprg=:ModconfKeywordPrg let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ModconfKeywordPrg' endif -endif let &cpo = s:cpo_save unlet s:cpo_save From fdcb08264d6e8525a07b29c14863adc6ead83913 Mon Sep 17 00:00:00 2001 From: KnoP-01 Date: Fri, 20 Sep 2024 22:19:45 +0200 Subject: [PATCH 4/5] patch 9.1.0738: filetype: rapid files are not recognized Problem: filetype: rapid files are not recognized Solution: detect '*.sysx' and '*.modx' as rapid filetype (KnoP-01) closes: #15669 Signed-off-by: KnoP-01 Signed-off-by: Christian Brabandt --- runtime/filetype.vim | 18 +++++++++++++----- src/testdir/test_filetype.vim | 1 + src/version.c | 2 ++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 8f611893c6fc5..7c19fb60f896f 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -239,7 +239,11 @@ au BufNewFile,BufRead *.cmd " ABB RAPID or Batch file for MSDOS. au BufNewFile,BufRead *.sys call dist#ft#FTsys() if has("fname_case") - au BufNewFile,BufRead *.Sys,*.SYS call dist#ft#FTsys() + au BufNewFile,BufRead *.Sys,*.SYS call dist#ft#FTsys() +endif +au BufNewFile,BufRead *.sysx setf rapid +if has("fname_case") + au BufNewFile,BufRead *.sysX,*.Sysx,*.SysX,*.SYSX setf rapid endif " Batch file for 4DOS @@ -1243,9 +1247,9 @@ au BufNewFile,BufRead *.src call dist#ft#FTsrc() au BufNewFile,BufRead *.dat call dist#ft#FTdat() au BufNewFile,BufRead *.sub setf krl if has("fname_case") - au BufNewFile,BufRead *.Src,*.SRC call dist#ft#FTsrc() - au BufNewFile,BufRead *.Dat,*.DAT call dist#ft#FTdat() - au BufNewFile,BufRead *.Sub,*.SUB setf krl + au BufNewFile,BufRead *.Src,*.SRC call dist#ft#FTsrc() + au BufNewFile,BufRead *.Dat,*.DAT call dist#ft#FTdat() + au BufNewFile,BufRead *.Sub,*.SUB setf krl endif " Kimwitu[++] @@ -1498,7 +1502,11 @@ au BufNewFile,BufRead *.mmp setf mmp " ABB Rapid, Modula-2, Modsim III or LambdaProlog au BufNewFile,BufRead *.mod call dist#ft#FTmod() if has("fname_case") - au BufNewFile,BufRead *.Mod,*.MOD call dist#ft#FTmod() + au BufNewFile,BufRead *.Mod,*.MOD call dist#ft#FTmod() +endif +au BufNewFile,BufRead *.modx setf rapid +if has("fname_case") + au BufNewFile,BufRead *.modX,*.Modx,*.ModX,*.MODX setf rapid endif " Modula-3 (.m3, .i3, .mg, .ig) diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index d1588f3f68f68..b08c0f9b7b882 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -603,6 +603,7 @@ def s:GetFilenameChecks(): dict> radiance: ['file.rad', 'file.mat'], raku: ['file.pm6', 'file.p6', 'file.t6', 'file.pod6', 'file.raku', 'file.rakumod', 'file.rakudoc', 'file.rakutest'], raml: ['file.raml'], + rapid: ['file.sysx', 'file.Sysx', 'file.SysX', 'file.SYSx', 'file.SYSX', 'file.modx', 'file.Modx', 'file.ModX', 'file.MODx', 'file.MODX'], rasi: ['file.rasi'], ratpoison: ['.ratpoisonrc', 'ratpoisonrc'], rbs: ['file.rbs'], diff --git a/src/version.c b/src/version.c index 5f20651b159fa..ff2b77f0f1bb5 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 738, /**/ 737, /**/ From e6b01cfe01a2722ec55a011ae04c4c404e88f924 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Fri, 20 Sep 2024 22:26:56 +0200 Subject: [PATCH 5/5] runtime(dist): do not output a message if executable is not found closes: #15705 Signed-off-by: Christian Brabandt --- runtime/autoload/dist/vim.vim | 1 - runtime/autoload/dist/vim9.vim | 1 - 2 files changed, 2 deletions(-) diff --git a/runtime/autoload/dist/vim.vim b/runtime/autoload/dist/vim.vim index d51940653000c..bb858c5732357 100644 --- a/runtime/autoload/dist/vim.vim +++ b/runtime/autoload/dist/vim.vim @@ -19,7 +19,6 @@ if !has('vim9script') function dist#vim#IsSafeExecutable(filetype, executable) let cwd = getcwd() if empty(exepath(a:executable)) - echomsg a:executable .. " not found in $PATH" return v:false endif return get(g:, a:filetype .. '_exec', get(g:, 'plugin_exec', 0)) && diff --git a/runtime/autoload/dist/vim9.vim b/runtime/autoload/dist/vim9.vim index 8fa9380f5774f..2277f245330ca 100644 --- a/runtime/autoload/dist/vim9.vim +++ b/runtime/autoload/dist/vim9.vim @@ -7,7 +7,6 @@ vim9script export def IsSafeExecutable(filetype: string, executable: string): bool if empty(exepath(executable)) - echomsg executable .. " not found in $PATH" return v:false endif var cwd = getcwd()