Commit Graph
2704 Commits
Author SHA1 Message Date
Christian Clasonandカワリミ人形 807eb4434c vim-patch:9.1.0612: filetype: deno.lock file not recognized
Problem:  filetype: deno.lock file not recognized
Solution: detect 'deno.lock' as json filetype
          (カワリミ人形)

Reference:
https://docs.deno.com/runtime/manual/basics/modules/integrity_checking/#caching-and-lock-files

closes: vim/vim#15333

https://github.com/vim/vim/commit/df77c8ad3974e44df2e588de5f465072371cab69

Co-authored-by: カワリミ人形 <kawarimidoll+git@gmail.com>
2024-07-25 10:01:46 +02:00
Abao Zhang b4b4cf46a7 fix(health): fix pyenv root and python exepath detect issue
Fix the following two issues:

- pyenv root detection issue

When `PYENV_ROOT` environment variable is not set, neovim will detect
pyenv's root via `pyenv root` command, but which will be always fail
because `vim.fn.system()` returns result with additional `\n`. Using
`vim.system` instead prevents this problem. to trim it before check
whether it is exists

- python executable path detection issue

Filter unrelated `python-config` in cases where multiple python versions
are installed, e.g. `python-config`, `python3.10-config`,
`python3.11-config` etc.
2024-07-24 16:21:46 +02:00
Gregory Anders 79d492a421 vim-patch:9.1.0610: filetype: OpenGL Shading Language files are not detected (#29831)
Problem:  filetype: OpenGL Shading Language files are not detected
Solution: detect various file extensions as GLSL filetype, include
          indent and syntax script, do no longer recognize '*.comp'
          as Mason filetype (Gregory Anders)

closes: vim/vim#15317

https://github.com/vim/vim/commit/e4b991ed36f96dd01c6d75e46a04fd1a99180e58
2024-07-23 06:28:05 +08:00
Christian ClasonandEvgeni Chasnovski 2a24d0a435 vim-patch:9.1.0603: filetype: use correct extension for Dracula
Problem:  pattern detection for Dracula language uses "*lvs" and "*lpe".
          as there is no dot, those are not treated as extensions which
          they should (judging by 'runtime/syntax/dracula.vim' and
          common sense).
Solution: use "*.lvs" and "*.lpe" patterns (Evgeni Chasnovski)

closes: vim/vim#15303

https://github.com/vim/vim/commit/5fb801a74faaf3ef1262c2988b8801500ca71646

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2024-07-19 17:28:48 +02:00
f67a7365af vim-patch:9.1.0602: filetype: Prolog detection can be improved
Problem:  filetype: Prolog detection can be improved
Solution: update the prolog detection regex
          (igna_martinoli)

related: vim/vim#10835
related: vim/vim#15206
closes: vim/vim#15253

https://github.com/vim/vim/commit/37853b7de31ef34153fe76aa2b740d517ed0e5d4

N/A patch:

vim-patch:7347642: runtime(filetype): Fix Prolog file detection regex

Problem: filetype: .pro file detection for Prolog is broken
Solution: fixed the regex to only match on the tested
          cases (igna_martinoli)

fixes: vim/vim#10835
closes: vim/vim#15206

https://github.com/vim/vim/commit/7347642633eb2de23a78c51a4388c9080440eec4

Co-authored-by: igna_martinoli <ignamartinoli@protonmail.com>
Co-authored-by: clason <c.clason@uni-graz.at>
2024-07-19 14:42:02 +08:00
zeertzjq f73904f9d6 vim-patch:eb6d733: runtime(doc): fix more inconsistencies in assert function docs (#29796)
related: https://github.com/vim/vim/pull/15280#issuecomment-2233771449

closes: vim/vim#15285

https://github.com/vim/vim/commit/eb6d733bef312a0634770e023e8a41f0347f1503
2024-07-19 04:12:13 +00:00
Evgeni Chasnovski f61efe3fe7 perf(filetype): implement parent pattern pre-matching (#29660)
Problem: calling `vim.filetype.match()` has performance bottleneck in
  that it has to match a lot of Lua patterns against several versions of
  input file name. This might be the problem if users need to call it
  synchronously a lot of times.

Solution: add "parent pattern pre-matching" which can be used to quickly
  reject several potential pattern matches at (usually rare) cost of
  adding time for one extra Lua pattern match.

  "Parent pattern" is a manually added/tracked grouping of filetype
  patterns which should have two properties:
    - Match at least the same set of strings as its filetype patterns.
      But not too much more.
    - Be fast to match.

  For them to be effective, group should consist from at least three
  filetype patterns.

  Example: for a filetpye pattern ".*/etc/a2ps/.*%.cfg", both "/etc/"
  and "%.cfg" are good parent patterns (prefer the one which can group
  more filetype patterns).

  After this commit, `vim.filetype.match()` on most inputs runs ~3.4
  times faster (while some inputs may see less impact if they match
  many parent patterns).
2024-07-18 10:26:27 -05:00
Christian ClasonandWu, Zhenyu c69ea53c9d vim-patch:9.1.0596: filetype: devscripts config files are not recognized (#29773)
Problem:  filetype: Debian devscripts config files are not recognized
Solution: detect devscripts.conf and .devscripts files as sh filetype
          (sourced by /bin/sh)

closes: vim/vim#15227

https://github.com/vim/vim/commit/76c19028ffc8b00816df7bc48985c92f7bacbcfb

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-07-18 07:13:16 +00:00
zeertzjqandShane Harper 18f1a3aaa5 vim-patch:c1b3984: runtime(doc): minor updates. (#29778)
closes: vim/vim#15280

https://github.com/vim/vim/commit/c1b3984a7b3cd6adcd1f43e558cb04fad1af3182

Co-authored-by: Shane Harper <shane@shaneharper.net>
2024-07-18 08:08:56 +08:00
Amit Singh e29f245a10 fix(lsp): inlay hints are rendered in the correct order (#29707)
Problem:
When there are multiple inlay hints present at the same position, they
should be rendered in the order they are received in the response from
LSP as per the LSP spec. Currently, this is not respected.

Solution:
Gather all hints for a given position, and then set it in a single
extmark call instead of multiple set_extmark calls. This leads to fewer
extmark calls and correct inlay hints being rendered.
2024-07-17 16:44:53 +02:00
Riley BruinsandLewis Russell 05dcda8f9b fix(treesitter): recognize aliased parsers in omnifunc, query linter
**Problem:** A query file for something like `html_tags` will not be
given html node completion

**Solution:** Check for parser aliases before offering completions

Co-authored-by: Lewis Russell <me@lewisr.dev>
2024-07-17 12:13:53 +02:00
Christian ClasonandAvidSeeker 8e590cae83 vim-patch:9.1.0593: filetype: Asymptote files are not recognized
Problem:  filetype: Asymptote files are not recognized
Solution: detect '*.asy' files as asy filetype, include
          ftplugin and syntax plugin (AvidSeeker).

Reference: https://asymptote.sourceforge.io/

closes: vim/vim#15252

https://github.com/vim/vim/commit/3088ef094da721dac8c0363a6c9e14eaf9313929

Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
2024-07-17 11:11:58 +02:00
Christian ClasonandAvidSeeker 61ea466591 vim-patch:9.1.0592: runtime: filetype: Mediawiki files are not recognized
Problem:  filetype: Mediawiki files are not recognized
Solution: detect "*.mw" and "*.wiki" as mediawiki filetype,
          include basic syntax and filetype plugins.
          (AvidSeeker)

closes: vim/vim#15266

https://github.com/vim/vim/commit/b5844104ab1259e061e023ea6259e4eb002e7170

Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
2024-07-17 11:11:58 +02:00
Christian ClasonandJonas Dujava 4a7371c714 vim-patch:9.1.0591: filetype: *.wl files are not recognized
Problem:  filetype: *.wl files are not recognized
Solution: Detect '*.wl' files as Mathematica package files
          (Jonas Dujava)

closes: vim/vim#15269

https://github.com/vim/vim/commit/c6d7dc039342fbe1cf432c7f8e7e391063de210b

Co-authored-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-17 11:11:58 +02:00
Riley Bruins 1f2f460b4a fix(lsp): don't show codelens for buffers that don't support it (#29690) 2024-07-16 19:48:54 +02:00
Maria José Solano 5fe4ce6678 fix(snippet): modify base indentation when there's actually whitespace (#29670) 2024-07-16 19:30:22 +02:00
altermo 118ae7e5ed fix(tohtml): support ranges again 2024-07-16 15:07:40 +02:00
altermo 25db0a1385 fix(tohtml): extmark text may be out of bounds 2024-07-16 08:11:26 +01:00
zeertzjqandDominique Pellé c2b51e6c41 vim-patch:df62c62: runtime(doc): grammar fixes in options.txt (#29729)
closes: vim/vim#15265

https://github.com/vim/vim/commit/df62c62177bd4dffce880b7a5711594865090953

Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
2024-07-15 22:24:02 +00:00
Maria José Solano 8703e7bd12 docs(lpeg): merge upstream changes 2024-07-15 21:16:29 +01:00
04c158fbec docs: misc (#29622)
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-07-15 06:54:45 +08:00
Christian ClasonandYinzuo Jiang 79130c0fd3 vim-patch:9.1.0586: ocaml runtime files are outdated
Problem:  ocaml runtime files are outdated
Solution: sync those files with the upstream repo,
          detect a few more ocaml files
          (Yinzuo Jiang)

closes: vim/vim#15260

https://github.com/vim/vim/commit/700cf8cfa1e926e2ba676203b3ad90c2c2083f1d

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-14 23:55:57 +02:00
Christian ClasonandJonas Dujava 60734dc761 vim-patch:9.1.0583: filetype: *.pdf_tex files are not recognized
Problem:  filetype: *.pdf_tex files are not recognized
Solution: Detect '*.pdf_tex' files as tex filetype
          (Jonas Dujava)

Those files are generated by inkscape, when exporting, see e.g.
https://inkscape.org/doc/inkscape-man.html

closes: vim/vim#15250

https://github.com/vim/vim/commit/28145e005d646cb0477aa26ef69d0f651a9f9d27

Co-authored-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-14 12:21:11 +02:00
Lewis Russell b0f39f3ef5 Merge pull request #29632 from echasnovski/filetype-refactor
refactor(filetype): extract some functions, use more cache
2024-07-13 08:27:47 +01:00
zeertzjqandLemonBoy b1aa8f5eb8 vim-patch:9.1.0572: cannot specify tab page closing behaviour (#29682)
Problem:  cannot specify tab page closing behaviour
          (Gianluca Pacchiella)
Solution: Add the 'tabclose' option (LemonBoy).

fixes: vim/vim#5967
closes: vim/vim#15204

https://github.com/vim/vim/commit/5247b0b92e191a046b034171a3b34031e317735f

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-13 08:56:58 +08:00
Evgeni Chasnovski 708b5f86ba refactor(filetype): use Lua patterns without implicit anchoring 2024-07-12 21:16:09 +03:00
Evgeni Chasnovski 9d14b76089 refactor(filetype): extract expanding env. vars in separate function 2024-07-12 21:16:09 +03:00
Evgeni Chasnovski abf4b65a51 perf(filetype): cache (more) pattern data during "add" time 2024-07-12 21:16:09 +03:00
Evgeni Chasnovski c7e8fc6302 refactor(filetype): unify matching patterns with pos/neg priority
Problem: due to single list of sorted patterns, their matching inside
  `vim.filetype.match()` was done very similarly but with extra checks
  to stop processing negative priority patterns before extensions.

Solution: create separated sorted lists for patterns with non-negative
  and negative priorities. This allows to process them in a single
  extracted function making the main codeflow a bit nicer and more
  easily expandable.
2024-07-12 21:16:09 +03:00
zeertzjqandLemonBoy 83f42aa450 vim-patch:9.1.0568: Cannot expand paths from 'cdpath' setting
Problem:  Cannot expand paths from 'cdpath' setting
          (Daniel Hahler)
Solution: Implement 'cdpath' completion, add the new 'dir_in_path'
          completion type (LemonBoy)

fixes vim/vim#374
closes: vim/vim#15205

https://github.com/vim/vim/commit/a20bf69a3b32024cb7809be87af33bf9dc490a19

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-12 07:39:36 +08:00
Christian ClasonandChristian Brabandt afbe7736a4 vim-patch:9.1.0555: filetype: angular ft detection is still problematic
Problem:  filetype: angular ft detection is still problematic
          (after 9.1.0551)
Solution: detect htmlangular filetype only by inspecting the content,
          do not try to determine it from a generic name like
          '*.component.html'

For the reasons mentioned here:

https://github.com/vim/vim/pull/13594#issuecomment-1834465890

related: vim/vim#15190
related: vim/vim#13594
related: vim/vim#13604

https://github.com/vim/vim/commit/c03f631b7b01e672787b222a55898f8dcac8d859

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-11 00:41:40 +02:00
Christian ClasonandTomodachi94 17bc5af01b vim-patch:9.1.0553: filetype: *.mcmeta files are not recognized
Problem:  filetype: *.mcmeta files are not recognized
Solution: Detect '*.mcmeta' files as json filetype
          (Tomodachi94)

"pack.mcmeta" was added to the JSON tests because that is the most common
filename with that extension.

There are currently 34,000 instances of this file extension on GitHub:
https://github.com/search?q=path%3A*.mcmeta&type=code&p=2

.zip files with this extension have downloads in the millions on sites
like CurseForge:
https://www.curseforge.com/minecraft/search?page=1&pageSize=20&sortBy=relevancy&class=texture-packs

Further reading about the file extension:
https://minecraft.wiki/w/Tutorials/Creating_a_resource_pack#Creating_a_.MCMETA_file

closes: vim/vim#15189

https://github.com/vim/vim/commit/d33a518025765c4a3530ad6cfb6cab83a30c8f55

Co-authored-by: Tomodachi94 <tomodachi94@protonmail.com>
2024-07-10 09:31:48 +02:00
Christian ClasonandDennis van den Berg 7fa089f463 vim-patch:9.1.0551: filetype: htmlangular files are not properly detected
Problem:  filetype: htmlangular files are not properly detected
Solution: Use the new htmlangular filetype for angular files, because
          since angular v17, those are no longer valid HTML files.
          (Dennis van den Berg)

Since Angular 17, the new Control Flow Syntax is not valid HTML. This PR
adds a new filetype detection for the HTML templates of Angular.

It first checks the filename. The Angular convention is to use
*.component.html for the template. However, this is not mandatory.

If the filename does not match, it will check the contents of the file
if it contains:

  - One of the Control-Flow blocks: @if, @for, @switch, @defer
  - A structural directive: *ngIf, *ngFor, *ngSwitch, *ngTemplateOutlet
  - Builtin Angular elements: ng-template or ng-content
  - String interpolation: {{ something }}

This enables the Angular LSP to attach only to htmlangular filetypes, as
well as language parsers, such as tree-sitter.

closes: vim/vim#15190

https://github.com/vim/vim/commit/1ad194c0dfd82ca1e7a1b6f2fca89a487794158d

Co-authored-by: Dennis van den Berg <dennis.vandenberg@nedap.com>
2024-07-10 09:31:48 +02:00
Christian ClasonandYinzuo Jiang 136c11ca22 vim-patch:9.1.0550: filetype: antlr4 files are not recognized
Problem:  filetype: antlr4 files are not recognized
Solution: Detect '*.g4' as antlr4 filetype, include a simple antlr4
          syntax and filetype plugin (Yinzuo Jiang)

closes: vim/vim#15191

https://github.com/vim/vim/commit/4a7a4a3675b6ad90a525524ba4684925df212325

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-10 09:31:48 +02:00
zeertzjqandLemonBoy 545aafbeb8 vim-patch:9.1.0547: No way to get the arity of a Vim function (#29638)
Problem:  No way to get the arity of a Vim function
          (Austin Ziegler)
Solution: Enhance get() Vim script function to return the function
          argument info using get(func, "arity") (LemonBoy)

fixes: vim/vim#15097
closes: vim/vim#15109

https://github.com/vim/vim/commit/48b7d05a4f88c4326bd5d7a73a523f2d953b3e51

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-10 08:07:16 +08:00
Max Coplan d918ebe3b8 fix(diagnostic): fix backwards compatibility for goto_next and goto_prev (#29593) 2024-07-09 14:08:12 -05:00
zeertzjq 487f44a6c1 fix(lua): change some vim.fn.expand() to vim.fs.normalize() (#29583)
Unlike vim.fn.expand(), vim.fs.normalize() doesn't expand wildcards.
2024-07-09 19:17:50 +08:00
Evgeni Chasnovski dc04ef2a20 perf(filetype): skip contents check in match() if there is no contents (#29596)
Problem: `vim.filetype.match()` tries to match on contents even if there
  is no contents (empty buffer or `{''}` explicit contents).
  This results in extra avoidable execution duration for cases.
  It matters, for example, when trying to match filetype based solely
  on file name (which still needs `contents` or `buf` to properly match
  earlier in the code path).

Solution: skip matching based solely on contents if it is `{''}`. This
  works because:
    - Matching solely on content is done after any user-configured
      `vim.filetype.add()` hooks.
    - All default matching on content might depend on supplied path
      *only* if there is non-empty content (like in
      `require('vim.filetype.detect').match_from_hashbang()`).
2024-07-08 11:20:32 -05:00
Christian ClasonandRiley Bruins 8aab46da5e vim-patch:94c1c66: runtime(tf): include tf ftplugin file
Adds ftplugin support for tf (TinyFugue). Comment support taken from
[here](https://github.com/kruton/tinyfugue/blob/1e8ac0bb014036c07bb3c679b0292ef20a6a0bb5/src/command.c#L568)

closes: vim/vim#15168

https://github.com/vim/vim/commit/94c1c6638a652cbe21b4d25ae5f26078e2e633d7

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Jaehwang Jung 8474f52978 fix(treesitter.foldexpr): robustness against ctrl-c
Problem:
Exiting the insert mode with ctrl-c does not trigger InsertLeave
autocmd. This may lead to nil error in treesitter foldexpr.

Solution:
Check nil. Folds still can be stale after exiting the insert mode with
ctrl-c, but it will be eventually updated correctly.

An alternative solution would be to ensure that exiting the insert mode
always triggers do_foldupdate. This can be done either by "fixing"
ctrl-c or with on_key callback that checks ctrl-c (nvim-cmp does this).
2024-07-08 11:06:26 +01:00
Christian ClasonandRiley Bruins bf92d423a9 vim-patch:9.1.0544: filetype: ldapconf files are not recognized
Problem:  filetype: ldapconf files are not recognized
Solution: Detect '.ldaprc', 'ldap.conf' and 'ldaprc' files as ldapconf
          filetype, include a simple ldapconf ftplugin file
          (Riley Bruins)

[Specification](https://www.openldap.org/software//man.cgi?query=ldap.conf&sektion=5&apropos=0&manpath=OpenLDAP+2.4-Release)

closes: vim/vim#15176

https://github.com/vim/vim/commit/62f31e949918167cb7f50cdf1737f7c28460b62b

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 11:03:51 +02:00
zeertzjq 435ce99213 vim-patch:9.1.0540: Unused assignment in sign_define_cmd()
Problem:  Unused assignment in sign_define_cmd()
Solution: Remove the assignment.  Also document the "priority" flag of
          sign_define(). (zeertzjq)

closes: vim/vim#15169

https://github.com/vim/vim/commit/fc3f5dba52099d82ccc8bfe309d58a6fac01373d
2024-07-08 06:20:22 +08:00
Stanislav Asunkin 5b778a64ec fix(health): fix fetching url with python in provider health (#29594) 2024-07-07 16:37:39 +08:00
zeertzjqandLemonBoy 6a886a2511 vim-patch:9.1.0538: not possible to assign priority when defining a sign (#29592)
Problem:  not possible to assign priority when defining a sign
          (Mathias Fußenegger)
Solution: Add the priority argument for the :sign-define ex command and
          the sign_define() function (LemonBoy)

Use the specified value instead of the default one (SIGN_DEF_PRIO) when
no priority is explicitly specified in sign_place or :sign place.

fixes: vim/vim#8334
closes: vim/vim#15124

https://github.com/vim/vim/commit/b975ddfdf96644b8df808415dee36f99abd48753

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-07 07:21:14 +08:00
Christian ClasonandChristian Brabandt 472b5b9b20 vim-patch:9.1.0536: filetype: zone files are not recognized
Problem:  filetype: zone files are not recognized
          (rpdprd)
Solution: Detect '*.zone' files as bindzone filetype

fixes: vim/vim#14222

https://github.com/vim/vim/commit/f095539b3900d76f5eeaaa0897c6abf970829b31

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-07 00:36:40 +02:00
zeertzjqanddistobs 5da9b49b19 vim-patch:9.1.0537: signed number detection for CTRL-X/A can be improved (#29590)
Problem:  signed number detection for CTRL-X/A can be improved
          (Chris Patuzzo)
Solution: Add the new "blank" value for the 'nrformat' setting. This
          will make Vim assume a signed number only if there is a blank
          in front of the sign.
          (distobs)

fixes: vim/vim#15033
closes: vim/vim#15110

https://github.com/vim/vim/commit/25ac6d67d92e0adda53b8d44b81c15031643ca1e

Co-authored-by: distobs <cuppotatocake@gmail.com>
2024-07-07 06:32:54 +08:00
Andreas Schneider 55e4301036 feat(lsp): drop fswatch, use inotifywait (#29374)
This patch replaces fswatch with inotifywait from inotify-toools:

https://github.com/inotify-tools/inotify-tools

fswatch takes ~1min to set up recursively for the Samba source code
directory. inotifywait needs less than a second to do the same thing.

https://github.com/emcrisostomo/fswatch/issues/321

Also it fswatch seems to be unmaintained in the meantime.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2024-07-06 11:44:19 +02:00
Zoltán Nyikos b109b1abce fix(glob): avoid subcapture nesting too deep error (#29520)
Use Cmt to evaluate Cond and Elem during match to avoid building the
nested capture structure later.
2024-07-06 11:40:08 +02:00
Christian ClasonandRiley Bruins 0abaccb2a7 vim-patch:9.1.0532: filetype: Cedar files not recognized
Problem:  filetype: Cedar files not recognized
Solution: Detect '*.cedar' files as cedar filetype
          (Riley Bruins)

References: https://github.com/cedar-policy

closes: vim/vim#15148

https://github.com/vim/vim/commit/15addb24dd3b2645f5c04d2742ab5eb53444a3a0

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-06 11:05:19 +02:00
Riley Bruins 9217e0d671 fix(treesitter): display fields for anonymous nodes in :InspectTree 2024-07-05 10:11:48 +02:00