Skip to content

Commit aba2ac1

Browse files
committed
Merge remote-tracking branch 'upstream/master' into tabsidebar
2 parents a5a62fa + 762a79e commit aba2ac1

34 files changed

+1965
-104
lines changed

.github/MAINTAINERS

+1
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ runtime/syntax/postscr.vim @mrdubya
577577
runtime/syntax/privoxy.vim @dkearns
578578
runtime/syntax/progress.vim @rdnlsmith
579579
runtime/syntax/prolog.vim @XVilka
580+
runtime/syntax/prql.vim @vanillajonathan
580581
runtime/syntax/ps1.vim @heaths
581582
runtime/syntax/ps1xml.vim @heaths
582583
runtime/syntax/psl.vim @danielkho

Filelist

+4
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,10 @@ LANG_GEN = \
10821082
runtime/tutor/Make_all.mak \
10831083
runtime/tutor/it/vim-01-beginner.tutor \
10841084
runtime/tutor/it/vim-01-beginner.tutor.json \
1085+
runtime/tutor/ru/vim-01-beginner.tutor \
1086+
runtime/tutor/ru/vim-01-beginner.tutor.json \
1087+
runtime/tutor/ru/vim-02-beginner.tutor \
1088+
runtime/tutor/ru/vim-02-beginner.tutor.json \
10851089
runtime/tutor/sr/vim-01-beginner.tutor \
10861090
runtime/tutor/sr/vim-01-beginner.tutor.json \
10871091
runtime/tutor/sr/vim-02-beginner.tutor \

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ VIM_FOR_SYNTAXTEST = ../../src/vim
6363

6464
# (For local testing only with GNU Make.)
6565
VIM_SYNTAX_TEST_FILTER =
66+
VIM_SYNTAX_TEST_WAIT_TIME =
6667

6768
syntaxtest:
6869
cd runtime/syntax && \

runtime/doc/builtin.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.1. Last change: 2025 Mar 11
1+
*builtin.txt* For Vim version 9.1. Last change: 2025 Mar 16
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -7275,6 +7275,9 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
72757275
given sequence.
72767276
limit Maximum number of matches in {list} to be
72777277
returned. Zero means no limit.
7278+
camelcase Use enhanced camel case scoring making results
7279+
better suited for completion related to
7280+
programming languages. Default is v:true
72787281

72797282
If {list} is a list of dictionaries, then the optional {dict}
72807283
argument supports the following additional items:

runtime/filetype.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,7 @@ au BufNewFile,BufRead *.hook
18141814
au BufNewFile,BufRead {.,}makepkg.conf setf sh
18151815

18161816
" Pacman log
1817-
au BufNewFile,BufRead pacman.log setf pacmanlog
1817+
au BufRead pacman.log* call s:StarSetf('pacmanlog')
18181818

18191819
" Pam conf
18201820
au BufNewFile,BufRead */etc/pam.conf setf pamconf

runtime/syntax/prql.vim

+178
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
" Vim syntax file
2+
" Language: PRQL
3+
" Maintainer: vanillajonathan
4+
" Last Change: 2025-03-07
5+
"
6+
" https://prql-lang.org/
7+
" https://github.com/PRQL/prql
8+
9+
" quit when a syntax file was already loaded.
10+
if exists("b:current_syntax")
11+
finish
12+
endif
13+
14+
" We need nocompatible mode in order to continue lines with backslashes.
15+
" Original setting will be restored.
16+
let s:cpo_save = &cpo
17+
set cpo&vim
18+
19+
syn keyword prqlBoolean false true
20+
syn keyword prqlSelf this that
21+
syn keyword prqlStatement null
22+
syn keyword prqlConditional case
23+
syn keyword prqlStatement prql let type alias in
24+
syn keyword prqlRepeat loop
25+
syn match prqlOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\|\~\)=\?"
26+
syn match prqlOperator display "&&\|||"
27+
syn keyword prqlInclude module
28+
29+
" Annotations
30+
syn match prqlAnnotation "@" display contained
31+
syn match prqlAnnotationName "@\s*{\h\%(\w\|=\)*}" display contains=prqlAnnotation
32+
33+
syn match prqlFunction "\h\w*" display contained
34+
35+
syn match prqlComment "#.*$" contains=prqlTodo,@Spell
36+
syn keyword prqlTodo FIXME NOTE TODO XXX contained
37+
38+
" Triple-quoted strings can contain doctests.
39+
syn region prqlString matchgroup=prqlQuotes
40+
\ start=+\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
41+
\ contains=prqlEscape,@Spell
42+
syn region prqlString matchgroup=prqlTripleQuotes
43+
\ start=+\z('''\|"""\)+ end="\z1" keepend
44+
\ contains=prqlEscape,prqlSpaceError,prqlDoctest,@Spell
45+
syn region prqlFString matchgroup=prqlQuotes
46+
\ start=+[f]\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
47+
\ contains=prqlEscape,@Spell
48+
syn region prqlFString matchgroup=prqlTripleQuotes
49+
\ start=+f\z('''\|"""\)+ end="\z1" keepend
50+
\ contains=prqlEscape,prqlSpaceError,prqlDoctest,@Spell
51+
syn region prqlRString matchgroup=prqlQuotes
52+
\ start=+r\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
53+
\ contains=@Spell
54+
syn region prqlRString matchgroup=prqlTripleQuotes
55+
\ start=+r\z('''\|"""\)+ end="\z1" keepend
56+
\ contains=prqlSpaceError,prqlDoctest,@Spell
57+
syn region prqlSString matchgroup=prqlQuotes
58+
\ start=+s\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
59+
\ contains=@Spell
60+
syn region prqlSString matchgroup=prqlTripleQuotes
61+
\ start=+s\z('''\|"""\)+ end="\z1" keepend
62+
\ contains=prqlSpaceError,prqlDoctest,@Spell
63+
64+
syn match prqlEscape +\\[bfnrt'"\\]+ contained
65+
syn match prqlEscape "\\\o\{1,3}" contained
66+
syn match prqlEscape "\\x\x\{2}" contained
67+
syn match prqlEscape "\%(\\u\x\{1,6}\)" contained
68+
syn match prqlEscape "\\$"
69+
70+
" It is very important to understand all details before changing the
71+
" regular expressions below or their order.
72+
" The word boundaries are *not* the floating-point number boundaries
73+
" because of a possible leading or trailing decimal point.
74+
" The expressions below ensure that all valid number literals are
75+
" highlighted, and invalid number literals are not. For example,
76+
"
77+
" - a decimal point in '4.' at the end of a line is highlighted,
78+
" - a second dot in 1.0.0 is not highlighted,
79+
" - 08 is not highlighted,
80+
" - 08e0 or 08j are highlighted,
81+
"
82+
if !exists("prql_no_number_highlight")
83+
" numbers (including complex)
84+
syn match prqlNumber "\<0[oO]\%(_\=\o\)\+\>"
85+
syn match prqlNumber "\<0[xX]\%(_\=\x\)\+\>"
86+
syn match prqlNumber "\<0[bB]\%(_\=[01]\)\+\>"
87+
syn match prqlNumber "\<\%([1-9]\%(_\=\d\)*\|0\+\%(_\=0\)*\)\>"
88+
syn match prqlNumber "\<\d\%(_\=\d\)*[jJ]\>"
89+
syn match prqlNumber "\<\d\%(_\=\d\)*[eE][+-]\=\d\%(_\=\d\)*[jJ]\=\>"
90+
syn match prqlNumber
91+
\ "\<\d\%(_\=\d\)*\.\%([eE][+-]\=\d\%(_\=\d\)*\)\=[jJ]\=\%(\W\|$\)\@="
92+
syn match prqlNumber
93+
\ "\%(^\|\W\)\zs\%(\d\%(_\=\d\)*\)\=\.\d\%(_\=\d\)*\%([eE][+-]\=\d\%(_\=\d\)*\)\=[jJ]\=\>"
94+
endif
95+
96+
" https://prql-lang.org/book/reference/stdlib/transforms/
97+
"
98+
" PRQL built-in functions are in alphabetical order.
99+
"
100+
101+
" Built-in functions
102+
syn keyword prqlBuiltin aggregate derive filter from group join select sort take window
103+
104+
" Built-in types
105+
syn keyword prqlType bool float int int8 int16 int32 int64 int128 text date time timestamp
106+
107+
" avoid highlighting attributes as builtins
108+
syn match prqlAttribute /\.\h\w*/hs=s+1
109+
\ contains=ALLBUT,prqlBuiltin,prqlFunction
110+
\ transparent
111+
112+
if exists("prql_space_error_highlight")
113+
" trailing whitespace
114+
syn match prqlSpaceError display excludenl "\s\+$"
115+
" mixed tabs and spaces
116+
syn match prqlSpaceError display " \+\t"
117+
syn match prqlSpaceError display "\t\+ "
118+
endif
119+
120+
" Do not spell doctests inside strings.
121+
" Notice that the end of a string, either ''', or """, will end the contained
122+
" doctest too. Thus, we do *not* need to have it as an end pattern.
123+
if !exists("prql_no_doctest_highlight")
124+
if !exists("prql_no_doctest_code_highlight")
125+
syn region prqlDoctest
126+
\ start="^\s*>>>\s" end="^\s*$"
127+
\ contained contains=ALLBUT,prqlDoctest,prqlFunction,@Spell
128+
syn region prqlDoctestValue
129+
\ start=+^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$"
130+
\ contained
131+
else
132+
syn region prqlDoctest
133+
\ start="^\s*>>>" end="^\s*$"
134+
\ contained contains=@NoSpell
135+
endif
136+
endif
137+
138+
" The default highlight links. Can be overridden later.
139+
hi def link prqlBoolean Boolean
140+
hi def link prqlStatement Statement
141+
hi def link prqlType Type
142+
hi def link prqlConditional Conditional
143+
hi def link prqlRepeat Repeat
144+
hi def link prqlOperator Operator
145+
hi def link prqlInclude Include
146+
hi def link prqlAnnotation Define
147+
hi def link prqlAnnotationName Function
148+
hi def link prqlFunction Function
149+
hi def link prqlComment Comment
150+
hi def link prqlTodo Todo
151+
hi def link prqlSelf Constant
152+
hi def link prqlString String
153+
hi def link prqlFString String
154+
hi def link prqlRString String
155+
hi def link prqlSString String
156+
hi def link prqlQuotes String
157+
hi def link prqlTripleQuotes prqlQuotes
158+
hi def link prqlEscape Special
159+
if !exists("prql_no_number_highlight")
160+
hi def link prqlNumber Number
161+
endif
162+
if !exists("prql_no_builtin_highlight")
163+
hi def link prqlBuiltin Function
164+
endif
165+
if exists("prql_space_error_highlight")
166+
hi def link prqlSpaceError Error
167+
endif
168+
if !exists("prql_no_doctest_highlight")
169+
hi def link prqlDoctest Special
170+
hi def link prqlDoctestValue Define
171+
endif
172+
173+
let b:current_syntax = "prql"
174+
175+
let &cpo = s:cpo_save
176+
unlet s:cpo_save
177+
178+
" vim:set sw=2 sts=2 ts=8 noet:

runtime/syntax/testdir/README.txt

+10-10
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Adjusting a syntax plugin test
117117

118118
If you make changes to the syntax plugin, you should add code to the input
119119
file to see the effect of these changes. So that the effect of the changes
120-
are covered by the test. You can follow these steps:
120+
is covered by the test. You can follow these steps:
121121

122122
1. Edit the syntax plugin somewhere in your personal setup. Use a file
123123
somewhere to try out the changes.
@@ -133,19 +133,19 @@ are covered by the test. You can follow these steps:
133133
Fix the syntax plugin until the result is good.
134134
2. Edit the input file for your language to add the items you have improved.
135135
(TODO: how to add another screendump?).
136-
Run the tests and you should get failures. Like with the previous step,
137-
carefully check that the new screendumps in the "failed" directory are
138-
good. Update the syntax plugin and the input file until the highlighting
139-
is good and you can see the effect of the syntax plugin improvements. Then
140-
move the screendumps from the "failed" to the "dumps" directory. Now "make
141-
test" should succeed.
136+
Run the tests and you should get failures. (You may opt for faster failure
137+
by assigning a small number, e.g. "1", to a VIM_SYNTAX_TEST_WAIT_TIME
138+
environment variable and gambling away an "uncertain" possibility of
139+
success.) Like with the previous step, carefully check that the new
140+
screendumps in the "failed" directory are good. Update the syntax plugin
141+
and the input file until the highlighting is good and you can see the
142+
effect of the syntax plugin improvements. Then move the screendumps from
143+
the "failed" to the "dumps" directory. Now "make test" should succeed.
142144
3. Prepare a pull request with the modified files:
143145
- syntax plugin: syntax/{name}.vim
144146
- Vim setup file: syntax/testdir/input/setup/{name}.vim (if any)
145147
- test input file: syntax/testdir/input/{name}.{ext}
146-
- test dump files: syntax/testdir/dumps/{name}_00.dump
147-
syntax/testdir/dumps/{name}_01.dump (if any)
148-
...
148+
- test dump files: syntax/testdir/dumps/{name}_*.dump
149149

150150
As an extra check you can temporarily put back the old syntax plugin and
151151
verify that the tests fail. Then you know your changes are covered by the

runtime/syntax/testdir/runtest.vim

+9-5
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,11 @@ func RunTest()
383383
enddef
384384
END
385385
let MAX_FAILED_COUNT = 5
386-
lockvar MAX_FAILED_COUNT XTESTSCRIPT
386+
let DUMP_OPTS = exists("$VIM_SYNTAX_TEST_WAIT_TIME") &&
387+
\ !empty($VIM_SYNTAX_TEST_WAIT_TIME)
388+
\ ? {'wait': max([1, str2nr($VIM_SYNTAX_TEST_WAIT_TIME)])}
389+
\ : {}
390+
lockvar DUMP_OPTS MAX_FAILED_COUNT XTESTSCRIPT
387391
let ok_count = 0
388392
let failed_tests = []
389393
let skipped_count = 0
@@ -398,8 +402,8 @@ func RunTest()
398402
\ ->join('\|')
399403
\ : ''
400404

401-
" Treat "\.self-testing$" as a string NOT as a regexp.
402-
if filter ==# '\.self-testing$'
405+
" Treat "^self-testing" as a string NOT as a regexp.
406+
if filter ==# '^self-testing'
403407
let dirpath = 'input/selftestdir/'
404408
let fnames = readdir(dirpath, {fname -> fname !~ '^README\.txt$'})
405409
else
@@ -472,7 +476,7 @@ func RunTest()
472476
let ruler = s:TermWaitAndPollRuler(buf, in_name_and_out_name)
473477
call ch_log('First screendump for ' .. in_name_and_out_name)
474478
" Make a screendump at the start of the file: failed/root_00.dump
475-
let fail = VerifyScreenDump(buf, root_00, {})
479+
let fail = VerifyScreenDump(buf, root_00, DUMP_OPTS)
476480

477481
" Accommodate the next code block to "buf"'s contingency for self
478482
" wipe-out.
@@ -492,7 +496,7 @@ func RunTest()
492496
\ in_name_and_out_name)
493497
call ch_log('Next screendump for ' .. in_name_and_out_name)
494498
" Make a screendump of every 18 lines of the file: failed/root_NN.dump
495-
let fail += VerifyScreenDump(buf, root_next, {})
499+
let fail += VerifyScreenDump(buf, root_next, DUMP_OPTS)
496500
endwhile
497501
call StopVimInTerminal(buf)
498502
finally

0 commit comments

Comments
 (0)