summaryrefslogtreecommitdiffstats
path: root/runtime/syntax
AgeCommit message (Collapse)Author
2024-07-07runtime(syntax-tests): Stop generating redundant "*_99.dump" filesAliaksei Budavei
- Remove the code handling their generation. - Remove the code written for the shell filetype to clear up the buffer screen before such a file can be generated. - Remove all but "yaml.yaml_99.dump" of such generated files (since there is no published "input/yaml.yaml.yaml", let its maintainer regenerate screen dump files and remove redundant ones). The new algorithm turns a "*_99.dump" file obsolete because all lines written in such a file will already be present in lower-numbered "*.dump" files. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-07runtime(vim): Update base-syntax, improve :match command highlightingDoug Kearns
Match group and pattern arguments to :match commands. closes: #15096 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-06runtime(syntax-tests): Abort and report failed cursor progressAliaksei Budavei
Track the cursor forward progress through a syntax test file so that any degenerate input can be checked and reported. closes: #15150 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-06runtime(syntax-tests): Introduce self tests for screen dumpingAliaksei Budavei
Write a batch of test files with made-up syntax to serve for additional linewise checks to be manually performed whenever the algorithm for screen dump file generation is modified. Define a shell variable VIM_SYNTAX_SELF_TESTING to run these tests: cd runtime/syntax/ VIM_SYNTAX_SELF_TESTING=1 make clean test related: #15150 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-06runtime(syntax-tests): Clear and redraw the ruler line with the shell infoAliaksei Budavei
The current contents of sh_01_99.dump and sh_09_99.dump begin with ":redraw" in the ruler line whereas both the comment and the need for the redraw command execution imply blanks " ". related: #15150 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-06runtime(syntax-tests): Allow for folded and wrapped lines in syntax test filesAliaksei Budavei
The current implementation falls short for syntax test files on two accounts: 1. With folded lines -- some lines before folded lines are unnecessarily repeated in generated dump files because closed folded lines are always treated as opened for the cursor to move _in_ instead of to move _over_ them. 2. With wrapped lines (longer than 75 columns) -- some lines are omitted in generated dump files because calculations for the cursor progress and its movement commands only refer to file lines and not their layout within a 20x75 buffer (less &cmdheight). As an alternative, we abandon deterministic (and inaccurate at times) calculations for the cursor progress and, instead, advance the cursor by as much as before for a single dump file, but now rely on marking the last visible line and additional movement to position lines at desired offsets, carefully preserving compatibility for the &scrolloff and &ruler values inherited from defaults.vim. The parent Vim process will keep track of progress through a syntax test file made by its child process ("terminal") by reading the rightmost end of the ruler line from the terminal buffer, looking for " All " or " Bot " for its cue to finish dump file generation. With these changes applied, the lossless line length limit will be raised from 75 to 1425 (for a 19x75 view) columns. Also, prefer "lastline" to "truncate" for &display; hiding the content of any last _long_ line in a view goes against the purpose of syntax file testing -- all lines should be recorded. related: #15150 fixes: #14245 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-04patch 9.1.0527: inconsistent parameter in Makefiles for Vim executablev9.1.0527RestorerZ
Problem: inconsistent parameter in Makefiles for Vim executable Solution: consistently use $VIMPROG across all Makefiles (RestorerZ) closes: #15099 Signed-off-by: RestorerZ <restorer@mail2k.ru> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-04runtime(dockerfile): enable spellchecking of comments in syntax scriptKafva
closes: #15147 Signed-off-by: Kafva <36083692+Kafva@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-23runtime(java): Compose "g:java_highlight_signature" and ↵Aliaksei Budavei
"g:java_highlight_functions" With the variables defined, distinctly highlight parts of a method declaration header: its name and parameter list parens, from its type parameters, return type, and formal parameters; and distinctly highlight parts of a lambda expression: its parameter list parens and the arrow, from its formal parameters and identifiers. closes: #15083 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-22runtime(vim): Update base-syntax, fix function tail commentsDoug Kearns
Match Vim9-script comments after :def and :enddef and legacy-script comments after :func and :endfunc, in any definition context. Highlight incorrect comment types after these commands as errors. fixes: #15062 closes: #15072 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-21runtime(scheme): update runtime filesEvan Hanson
Add TODO highlighting, disable text-wrapping, add "define-library" to lispwords on CHICKEN. Update MAINTAINERS. closes: #15063 Signed-off-by: Evan Hanson <evhan@foldling.org> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-20runtime(java): Optionally highlight parameterised typesAliaksei Budavei
In the presence of parameterised types whose names begin with a capital letter and end with a less-than sign "<" that introduces a type argument or a list of comma-separated type arguments, followed by a greater-than sign ">", a variable "g:java_highlight_generics" can be defined to have some components of such types uniformly coloured (by picking highlight groups for javaGenericsC{1,2}, javaWildcardBound). For example, ------------------------------------------------------------ java.io.InputStream stream = java.io.InputStream.nullInputStream(); java.util.function.Function<String, java.util.function.BiFunction<String, String, String>> updater = property -> (oldValue, newValue) -> oldValue; java.util.logging.LogManager.getLogManager() .updateConfiguration(stream, updater); ------------------------------------------------------------ Note that the diamond form and explicit type arguments do not qualify for this kind of recognition. For example, ------------------------------------------------------------ new java.util.HashSet<>().<String>toArray(new String[0]); ------------------------------------------------------------ References: https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.5 https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.9 https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.12.2.1 closes: #15050 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-19runtime(java): Remove the group exclusion list from @javaTopAliaksei Budavei
Instances of anonymous classes can be passed as method arguments and should be subject to line folding as well. closes: #15048 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-18runtime(csv): include a simple csv filetype and syntax pluginMaxim Kim
fixes: #15038 Signed-off-by: Maxim Kim <habamax@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-17runtime(doc): Fix typos in several documentsh-east
closes: #15034 Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-16runtime(html): bump length of character references in syntax script (#15022)Mohamed Akram
This allows handling longer references such as `&CounterClockwiseContourIntegral;`. Signed-off-by: Mohamed Akram <mohd.akram@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-16runtime(kdl): fix KdlIndent and kdlComment in indent script (#15019)Yinzuo Jiang
Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-16runtime(java): Fold multi-line comments with the syntax kind of &fdm (#15016)Aliaksei Budavei
Also: - Restore the capability to mark as an error braces nested in parens with g:javaInParen. - Try not to fold top-level-type bodies. (Defining multiple package-private top level types in a single source file is not recommended as it can impose order among compilation units; so it is assumed that only one such top level type is usually defined.) - Compose ‘method header’ highlighting and block braces folding. - Do not highlight block braces whenever ‘method header’ highlighting is requested. This bundling of ‘method headers’ and block braces for highlighting can be traced back to Vim v5.0; however, no comment or documentation entry conveys any justification. For example, it is hard to discover the connection between block braces for "while", "if", etc., statements and method body block braces. The former behaviour can be attained in, e.g. ~/.vim/after/syntax/java.vim: ------------------------------------------------------------ if exists("g:java_highlight_functions") syn clear javaBlock javaInParen syn match javaBlockOther "[{}]" syn region javaBlock transparent matchgroup=javaBlockStart \ start="\%(^\|^\S[^:]\+\)\@120<!{" end="}" fold hi def link javaBlockStart javaFuncDef hi def link javaBlockOther javaBlockStart if exists("g:java_mark_braces_in_parens_as_errors") syn match javaInParen contained "[{}]" endif endif ------------------------------------------------------------ Note: Read ‘a method header omitting a _throws_ clause’ for every ‘method header’ appellation used above. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-15runtime(vim): Update base-syntax, match shebang lines (#15011)dkearns
Match shebang lines in Vim9 and legacy script. Mark these as an error if they appear anywhere other than the first line of a legacy-script file. In Vim9 script these match as normal line comments rather than an error. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-14runtime(html): Restore HTML syntax file testsDoug Kearns
Rendered element content results in test failures on macOS and FreeBSD. The included content for these elements was incidental to the primary intent of the test to check element tag highlighting so set g:html_no_rendering to disable content rendering. FreeBSD fails for even an empty <strike> element. See #13591 and #14215. closes: #13595 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-14runtime(vim): Update base-syntax, match :sleep argDoug Kearns
Match :sleep arg properly including a lone "m" with a leading count. closes: #15003 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-13runtime(vim): Update base-syntax, match :catch and :throw args (#14989)dkearns
Match :catch /{pattern}/ and :throw {expr1}. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-13runtime(java): Include element values in non-marker annotations (#14979)Aliaksei Budavei
Make a formal definition for normal and single-element kinds of annotations that otherwise require for their containment to repeat each time all syntax groups that describe element values. Reference: https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.7 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-12runtime(vim): Update g:vimsyn_comment_strings dump file testsDoug Kearns
Leading whitespace is no longer matched as part of the line comment as of #13936. closes: #14971 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-11runtime(vim): Update base-syntax, configurable comment string highlighting ↵dkearns
(#14931) Allow highlighting of strings within comments to be disabled by setting g:vimsyn_comment_strings to false. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-11runtime(vim): Update base-syntax, match multiline continued comments (#13936)dkearns
Match multiline (continued) line comments. Continued tail comments are not supported yet. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-11runtime(vim): Remove orphaned screen dump files (#14965)dkearns
These are no longer generated by the current test input files. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-10runtime(kdl): include syntax, indent and ftplugin filesinzuo Jiang
closes: #14956 Co-authored-by: Aram Drevekenin <aram@poor.dev> Signed-off-by: inzuo Jiang <jiangyinzuo@foxmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-10runtime(deb822sources): add missing Enabled field in syntax scriptKentaro Hayashi
closes: #14898 It lacks the support of Enabled: boolean option field [1]: e.g. Types: deb Uris: https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs/ Components: main Suites: vscodium Architectures: amd64 i386 arm64 armhf Enabled: yes Signed-By: /var/lib/extrepo/keys/vscodium.asc This patch was also forwarded to upstream. [2] [1] https://manpages.debian.org/unstable/apt/sources.list.5.en.html#DEB822-STYLE_FORMAT [2] https://salsa.debian.org/vim-team/vim-debian/-/merge_requests/16 Signed-off-by: Kentaro Hayashi <kenhys@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-09runtime(java): Exclude lambda expressions from _when_ _switch-case_ label ↵Aliaksei Budavei
clauses (#14945) These guard clauses are always boolean expressions, whereas lambda expressions can only appear in either an assignment, a casting, or an invocation context. References: https://docs.oracle.com/javase/specs/jls/se21/html/jls-14.html#jls-14.11.1 https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.27 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-05runtime(vim): Update base-syntax, allow whitespace before :substitute patternDoug Kearns
Allow whitespace between the :substitute command and its pattern argument. Although unusual, it is supported and there are examples in the wild. Match Vi compatible :substitute commands like :s\/{string}/. See :help E1270. fixes: #14920 closes: #14923 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-03patch 9.1.0465: missing filecopy() functionv9.1.0465Shougo Matsushita
Problem: missing filecopy() function Solution: implement filecopy() Vim script function (Shougo Matsushita) closes: #12346 Co-authored-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-03patch 9.1.0464: no whitespace padding in commentstring option in ftpluginsv9.1.0464Riley Bruins
Problem: no whitespace padding in commentstring option in ftplugins Solution: Change default to include whitespace padding, update existing filetype plugins with the new default value (Riley Bruins) closes: #14843 Signed-off-by: Riley Bruins <ribru17@hotmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-31patch 9.1.0453: filetype: rasi files are not recognizedv9.1.0453Pierrick Guillaume
Problem: filetype: rasi files are not recognized Solution: regonize '*.rasi' files as rasi filetype, include a filetype and syntax plugin (Pierrick Guillaume) ported from: https://github.com/Fymyte/rasi.vim closes: #14821 Signed-off-by: Pierrick Guillaume <pierguill@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-31runtime(java): Improve the matching of lambda expressions (#14880)Aliaksei Budavei
- Distinguish some formal parameters. - Support multi-line definitions. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-28runtime(stylus): remove remaining css code (#14866)zeertzjq
This seems to be a forgotten fixup in https://github.com/vim/vim/commit/2d919d2744a99c9bb9e79984e85b8e8f5ec14c07#r141568461 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-27runtime(vim): re-generate vim syntax from generatorChristian Brabandt
related: #14861 Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-27runtime(vim): fix syntax vim bug (Close #14858) (#14861)h_east
Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-26runtime(typescriptreact): fix highlighting nested and escaped quotes in ↵Linda_pp
string props (#14852) Signed-off-by: rhysd <lin90162@yahoo.co.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-25runtime(debian): update Debian runtime files (#14849)James McCoy
* Add space in template for 'commentstring' * Add 'comments' and 'commentstring' support to debcontrol * debversions: Move Ubuntu releases outside of standard support to unsupported Although trust, xenial, and bionic are not EOL yet, their standard support period has ended. Reported-by: Riley Bruins <ribru17@gmail.com> Co-authored-by: Riley Bruins <ribru17@gmail.com> Signed-off-by: James McCoy <jamessan@debian.org> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-24runtime(typescript): update outdated syntax filesrhysd
fixes: #14721 fixes: HerringtonDarkholme/yats.vim#277 closes: #14840 Signed-off-by: rhysd <lin90162@yahoo.co.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-24runtime(i3config/swayconfig): fix floating_modifier highlight (#14841)Josef Litoš
Signed-off-by: JosefLitos <litosjos@fit.cvut.cz> Signed-off-by: James Eapen <james.eapen@vai.org> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-24patch 9.1.0442: hare runtime files outdatedv9.1.0442Amelia Clarke
Problem: hare runtime files outdated Solution: runtime(hare): update hare.vim to match upstream (Amelia Clarke) closes: #14836 Signed-off-by: Amelia Clarke <selene@perilune.dev> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-23runtime(i3config/swayconfig): support floating_modifier none; revert broken ↵James Eapen
highlighting - fix floating_modifier $mod normal|inverse was being hightlighted as error reverting the floating_modifier change from dd83b63 - will currently allow invalid syntax after floating_modifier fixes: #14826 closes: #14827 Co-authored-by: JosefLitos <litosjos@fit.cvut.cz> Signed-off-by: James Eapen <james.eapen@vai.org> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-13runtime(i3config/swayconfig): allow indented commands (#14757)Josef Litoš
fixes: #14752 Co-authored-by: jamespeapen <jamespeapen@users.noreply.github.com> Signed-off-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-13runtime(syntax-tests): Filter out non-Latin-1 characters for syntax tests ↵Aliaksei Budavei
(#14767) Syntax tests are run with the LC_ALL=C environment variable passed to "make". Occasionally, there are CI failures for such test files containing non-Latin-1 characters with error messages pointing to multi-byte characters: https://github.com/vim/vim/actions/runs/8824925004/job/24228298023#step:10:16370 , https://github.com/vim/vim/actions/runs/8840856619/job/24276935260#step:10:16347 , https://github.com/vim/vim/actions/runs/8854043458/job/24316210645#step:10:16362 , https://github.com/vim/vim/actions/runs/8856501136/job/24322848765#step:10:16354 , https://github.com/vim/vim/actions/runs/9038417238/job/24839482152#step:11:16980 . But since the very same unchanged tests pass at other times: https://github.com/vim/vim/actions/runs/8827593571/job/24235935458#step:10:16353 , https://github.com/vim/vim/actions/runs/9065214647/job/24905321661#step:11:17002 ; these failures are unrelated to the nature of syntax tests and should be considered false positives. As a temporary workaround, all bytes of known non-Latin-1 characters can be replaced in memory with an arbitrary ASCII byte (?) by applying a filter > " To ignore part of the dump, provide a "dumps/{filename}.vim" file with > " Vim commands to be applied to both the reference and the current dump, so > " that parts that are irrelevant are not used for the comparison. The result > " is NOT written, thus "term_dumpdiff()" shows the difference anyway. before lines are compared between files. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-10runtime(java): Strive to remain compatible for at least Vim 7.0 (#14744)Aliaksei Budavei
Also: - Limit all look-behind regexp patterns. - Cache regexp capabilities for [:upper:] and [:lower:]. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-10runtime(java): Stop handpicking syntax groups for @javaTop (#14727)Aliaksei Budavei
* runtime(java): Stop handpicking syntax groups for @javaTop Also: - Remove the obsolete comment for g:java_allow_cpp_keywords. - Remove the commented out groups java\%[Debug\]StringError. - Infer and set the preferred formatting Vim options from the modeline. Since vim-6-0u, non-contained syntax groups can be referred to by using the "contains=TOP..." argument. * Set &encoding and &termencoding to "utf-8" for test files * Limit non-ASCII charset to [§ƒɐɘʬʭΑ-Τα-μ] for test files Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-08runtime(spec): add new items to scripts section in syntax pluginMaxwell G
- %generate_buildrequires — added in RPM 4.15 - %conf — added in RPM 4.18 closes: #14723 Ref: https://rpm-software-management.github.io/rpm/manual/spec.html#build-scriptlets Signed-off-by: author Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-08patch 9.1.0396: filetype: jj files are not recognizedv9.1.0396Gregory Anders
Problem: jj files are not recognized Solution: recognize '*.jjdescription' files as jj filetype (Gregory Anders) See: https://github.com/martinvonz/jj closes: #14733 Signed-off-by: Gregory Anders <greg@gpanders.com> Signed-off-by: Christian Brabandt <cb@256bit.org>