runtime(vim): Update base syntax, fix incorrect function error

Don't match lower-case function names as errors when the qualifier
includes a dict/list accessor.

This is a less than perfect fix until qualified function call matching
is reworked.

fixes: #17766
closes: #17780

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns
2025-07-17 20:29:07 +02:00
committed by Christian Brabandt
parent f2290a6823
commit 175662f4f2
37 changed files with 242 additions and 234 deletions

View File

@ -1,7 +1,7 @@
vim9script
# Vim function calls
# VIM_SETUP highlight link vimUserFunc Todo
# VIM_SETUP highlight link vim9UserFunc Todo
# VIM_TEST_SETUP highlight link vimUserFunc Todo
# VIM_TEST_SETUP highlight link vim9UserFunc Todo
call abs(42)
@ -293,3 +293,23 @@ v:substitute.substitute()
substitute#substitute()
g:substitute#substitute()
# chained function calls
module.foo().bar()
# Issue 16721 (Vim script highlight of builtin function after |)
&directory = $'{$MYVIMDIR}/.data/swap/'
&backupdir = $'{$MYVIMDIR}/.data/backup//'
&undodir = $'{$MYVIMDIR}/.data/undo//'
if !isdirectory(&undodir) | mkdir(&undodir, "p") | endif
if !isdirectory(&backupdir) | mkdir(&backupdir, "p") | endif
if !isdirectory(&directory) | mkdir(&directory, "p") | endif
# Issue #17766 (valid function call highlighted as error)
module[0].foo()

View File

@ -1,18 +0,0 @@
vim9script
# Vim9 function calls
clearmatches()
:call clearmatches()
echo "Foo" | clearmatches()
# Issue 16721 (Vim script highlight of builtin function after |)
&directory = $'{$MYVIMDIR}/.data/swap/'
&backupdir = $'{$MYVIMDIR}/.data/backup//'
&undodir = $'{$MYVIMDIR}/.data/undo//'
if !isdirectory(&undodir) | mkdir(&undodir, "p") | endif
if !isdirectory(&backupdir) | mkdir(&backupdir, "p") | endif
if !isdirectory(&directory) | mkdir(&directory, "p") | endif

View File

@ -1,5 +1,5 @@
" Vim function calls
" VIM_SETUP highlight link vimUserFunc Todo
" VIM_TEST_SETUP highlight link vimUserFunc Todo
call abs(42)
@ -263,3 +263,13 @@ call v:substitute.substitute()
call substitute#substitute()
call g:substitute#substitute()
" chained function calls
call module.foo().bar()
" Issue #17766 (valid function call highlighted as error)
call module[0].foo()

View File

@ -1,6 +0,0 @@
" Vim function calls
call clearmatches()
:call clearmatches()
echo "Foo" | call clearmatches()