Commit Graph

6933 Commits

Author SHA1 Message Date
dundargoc
c791aa8aae docs: update supported platforms 2024-04-18 23:39:26 +02:00
Maria José Solano
97c0a52416
fix(lsp): correct deprecation message #28403 2024-04-18 12:06:52 -07:00
Justin M. Keyes
f1dfe32bf5
feat(lua): enable(enable:boolean, filter:table) #28374
Problem:
We need to establish a pattern for `enable()`.

Solution:
- First `enable()` parameter is always `enable:boolean`.
- Update `vim.diagnostic.enable()`
- Update `vim.lsp.inlay_hint.enable()`.
    - It was not released yet, so no deprecation is needed. But to help
      HEAD users, it will show an informative error.
- vim.deprecate():
    - Improve message when the "removal version" is a *current or older* version.
2024-04-18 07:57:58 -07:00
Mathias Fußenegger
97323d821b
refactor(lsp): merge rpc.domain_socket_connect into rpc.connect (#28398)
See discussion in https://github.com/neovim/neovim/pull/26850
2024-04-18 15:34:10 +02:00
Michael
96d0c709b6
fix(healthcheck): expand vimrc variable (#28379) 2024-04-17 14:31:13 +08:00
Famiu Haque
8e5c48b08d
feat(lua): vim.fs.normalize() resolves ".", ".." #28203
Problem:
`vim.fs.normalize` does not resolve `.` and `..` components. This makes
no sense as the entire point of normalization is to remove redundancy
from the path. The path normalization functions in several other
languages (Java, Python, C++, etc.) also resolve `.` and `..`
components.

Reference:
- Python: https://docs.python.org/3/library/os.path.html#os.path.normpath
- Java: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#normalize--
- C++: https://en.cppreference.com/w/cpp/filesystem/path/lexically_normal

Solution:
Resolve "." and ".." in `vim.fs.normalize`.

    Before:
    "~/foo/bar/../baz/./" => "~/foo/bar/../baz/."
    After:
    "~/foo/bar/../baz/./" => "~/foo/baz"
2024-04-16 12:13:44 -07:00
Luna Saphie Mittelbach
20b38677c2 feat(defaults): use ripgrep (rg) for 'grepprg' if available 2024-04-16 19:21:02 +02:00
Justin M. Keyes
fe4583127f
fix: vim.validate() order is not deterministic #28377
Problem:
The order of the validation performed by vim.validate() is
unpredictable.
- harder to write reliable tests.
- confusing UX because validation result might return different errors randomly.

Solution:
Iterate the input using `vim.spairs()`.

Future:
Ideally, the caller could provide an "ordered dict".
2024-04-16 07:31:43 -07:00
Justin M. Keyes
3065e2fa5d
Merge #28227 feat(diagnostic): is_enabled, enable(…, enable:boolean) 2024-04-16 04:37:54 -07:00
zeertzjq
9b485e3f42
vim-patch:8a31de6dd275 (#28361)
compiler(rime_deployer): include new compiler, use it for '*.custom.yaml' files (vim/vim#14460)

8a31de6dd2

Co-authored-by: wzy <32936898+Freed-Wu@users.noreply.github.com>
2024-04-16 09:33:51 +08:00
zeertzjq
fb7ffac69f
vim-patch:9.1.0326: filetype: some requirements files are not recognized (#28360)
Problem:  filetype: some requirements files are not recognized
Solution: Detect '*-requirements.txt', 'constraints.txt',
          'requirements.in', 'requirements/*.txt' and 'requires/*.txt'
          as requirements filetype, include pip compiler, include
          requirements filetype and syntax plugin
          (Wu, Zhenyu, @raimon49)

closes: vim/vim#14379

f9f5424d3e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: raimon <raimon49@hotmail.com>
2024-04-16 09:33:33 +08:00
zeertzjq
07661009c5
vim-patch:9.1.0325: CMakeCache.txt files not recognized (#28359)
vim-patch:9.1.0325: filetype: CMakeCache.txt files not recognized

Problem:  filetype: CMakeCache.txt files not recognized
Solution: Detect 'CMakeCache.txt' files as cmakecache filetype,
          include basic syntax script for cmakecache
          (Wu, Zhenyu, @bfrg)

closes: vim/vim#14384

62c09e032c

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: bfrg <bfrg@users.noreply.github.com>
2024-04-16 09:33:16 +08:00
zeertzjq
537ba34953
vim-patch:4052474a1bd2 (#28358)
runtime(java): Recognise non-ASCII identifiers (vim/vim#14543)

* runtime(java): Recognise non-ASCII identifiers

Also:

- Remove the already commented out and less general in its
  definition javaFuncDef alternative.

- Stop recognising some bespoke {p,trace} debugging API.

Non-ASCII identifiers have been supported from the outset
of the Java language.

> An _identifier_ is an unlimited-length sequence of _Java
> letters_ and _Java digits_, the first of which must be a
> Java letter.  An identifier cannot have the same spelling
> (Unicode character sequence) as a keyword . . . Boolean
> literal . . . or the null literal . . .
> . . . . . . . .
> Letters and digits may be drawn from the entire Unicode
> character set . . .
> . . . . . . . .
> A Java letter is a character for which the method
> Character.isJavaLetter . . . returns true.  A Java
> letter-or-digit is a character for which the method
> Character.isJavaLetterOrDigit . . . returns true.
> . . . . . . . .
> The Java letters include . . . for historical reasons, the
> ASCII underscore (_) . . . and dollar sign ($) . . .

(Separate syntax tests will be written when particular parts
now touched will have been further improved.)

Reference:
https://javaalmanac.io/jdk/1.0/langspec.pdf [§3.8]

* Take on the maintenance of Java filetype and syntax files

4052474a1b

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-04-16 09:32:55 +08:00
zeertzjq
ca2f24cbbd vim-patch:9.1.0324: filetype: some json files are not recognized
Problem:  filetype: some json files are not recognized
Solution: Detect '.jscsrc' and '.vsconfig' as jsonc filetype
          (Wu, Zhenyu)

See:
- https://github.com/microsoft/PowerToys/blob/main/.vsconfig
- https://jscs-dev.github.io/

closes: vim/vim#14452

c59a8648b2

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-16 08:32:08 +08:00
zeertzjq
fcf17c8859 vim-patch:9.1.0323: filetype: cabal config files may not be recognized
Problem:  filetype: cabal config files may not be recognized
Solution: Change filetype pattern to '*/{,.}cabal/config'
          (Wu Zhenyu)

closes: vim/vim#14498

799dedec0e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-16 08:22:37 +08:00
zeertzjq
6717cc5b41 vim-patch:9.1.0322: filetype: some mail tools not recognized
Problem:  filetype: some mail tools not recognized
Solution: Detect '.mbsncrc' as conf, '.msmtprc' as msmtp
          and '.notmuch-config' as ini filetype
          (Shane-XB-Qian)

closes: vim/vim#14533

a7a9a476cf

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2024-04-16 08:19:17 +08:00
zeertzjq
b4ddee1116
vim-patch:fb8f31ea7d7f (#28356)
runtime(doc): document pandoc compiler and enable configuring arguments

closes: vim/vim#14550

fb8f31ea7d

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-04-16 08:13:21 +08:00
Josef Litoš
8c970d3403
vim-patch:dd83b63eb5b7 (#28351)
runtime(i3config/swayconfig): update syntax scripts

modifications with the goals of:
- simplifying structure by using group `cluster`s
- improving visual highlighting responsiveness by using `nextgroup`
- improving recursive wm-msg command highlighting
- separating command variants meant for runtime and for config only

closes: vim/vim#14544

dd83b63eb5
2024-04-16 07:48:15 +08:00
Justin M. Keyes
5ed9916a28 feat(diagnostic): enable(…, opts)
Problem:
vim.diagnostic.enable() does not match the signature of vim.lsp.inlay_hint.enable()

Solution:
- Change the signature so that the first 2 args are (bufnr, enable).
- Introduce a 3rd `opts` arg.
    - Currently it only supports `opts.ns_id`.
2024-04-15 21:32:31 +02:00
Ivan Georgiev
603f3b36a4
fix(checkhealth): error in node.js check #28348
Problem:
:checkhealth node.js check fails:

    ERROR Failed to run healthcheck for "provider.node" plugin ...
    node/health.lua:98: attempt to call local 'message' (a string value)

`message` is called as a function, when it is actually a string.

Solution:
Pass `message` to `warn()` as an argument.

Fix #28346
2024-04-15 09:23:22 -07:00
Justin M. Keyes
26765e8461 feat(diagnostic): is_enabled, enable(…, enable:boolean)
Problem:
`vim.diagnostic.is_disabled` and `vim.diagnostic.disable` are unnecessary
and inconsistent with the "toggle" pattern (established starting with
`vim.lsp.inlay_hint`, see https://github.com/neovim/neovim/pull/25512#pullrequestreview-1676750276

As a reminder, the rationale is:
- we always need `enable()`
- we always end up needing `is_enabled()`
- "toggle" can be achieved via `enable(not is_enabled())`
- therefore,
    - `toggle()` and `disable()` are redundant
    - `is_disabled()` is a needless inconsistency

Solution:
- Introduce `vim.diagnostic.is_enabled`, and `vim.diagnostic.enable(…, enable:boolean)`
    - Note: Future improvement would be to add an `enable()` overload `enable(enable:boolean, opts: table)`.
- Deprecate `vim.diagnostic.is_disabled`, `vim.diagnostic.disable`
2024-04-15 13:54:33 +02:00
Justin M. Keyes
57adf8c6e0
fix(vim.ui): open() may wait indefinitely #28325
Problem:
vim.ui.open "locks up" Nvim if the spawned process does not terminate. #27986

Solution:
- Change `vim.ui.open()`:
    - Do not call `wait()`.
    - Return a `SystemObj`. The caller can decide if it wants to `wait()`.
- Change `gx` to `wait()` only a short time.
    - Allows `gx` to show a message if the command fails, without the
      risk of waiting forever.
2024-04-15 04:33:09 -07:00
zeertzjq
0f5c94c04b
vim-patch:4ba70cab37d2 (#28338)
runtime(vim): Update base-syntax, fix nested function folding (vim/vim#14397)

Only match function folding start and end patterns at the start of a
line, excluding heredocs and :append/:change/:insert commands.

Fixes vim/vim#14393

4ba70cab37

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-04-15 07:46:14 +08:00
zeertzjq
bcfad7fe62
vim-patch:e92ed1b45c54 (#28337)
runtime(vim): don't set compiler, update a comment for vimdoc compiler (vim/vim#14532)

e92ed1b45c

Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
2024-04-15 07:39:32 +08:00
zeertzjq
43f8d7e3ef
vim-patch:9.1.0329: String interpolation fails for Dict type (#28335)
Problem:  String interpolation fails for Dict type
Solution: Support Dict data type properly, also support :put =Dict
          (without having to convert it to string() first)
          (Yegappan Lakshmanan)

fixes: vim/vim#14529
closes: vim/vim#14541

f01493c550

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-15 07:11:39 +08:00
Sean Dewar
7180ef6901
feat(api)!: nvim_open_win: noautocmd blocks all autocmds #28192
Problem: noautocmd is confusing; despite its name, it doesn't block all
autocommands (instead it blocks only those related to setting the buffer), and
is commonly used by plugins to open windows while producing minimal
side-effects.

Solution: be consistent and block all autocommands when noautocmd is set.
This includes WinNew (again), plus autocommands from entering the window (if
enter is set) like WinEnter, WinLeave, TabEnter, .etc.

See the discussion at https://github.com/neovim/neovim/pull/14659#issuecomment-2040029517
for more information.

Remove win_set_buf's noautocmd argument, as it's no longer needed.

NOTE: pum_create_float_preview sets noautocmd for win_set_buf, but all its
callers already use block_autocmds.

Despite that, pum_create_float_preview doesn't actually properly handle
autocommands (it has no checks for whether those from win_enter or
nvim_create_buf free the window).

For now, ensure autocommands are blocked within it for correctness (in case it's
ever called outside of a block_autocmds context; the function seems to have been
refactored in #26739 anyway).
2024-04-14 16:10:16 -07:00
zeertzjq
aa1d0ac095
fix(defaults): only repeat macro for each selected line if linewise (#28289)
As mentioned in #28287, repeating a macro for each selected line doesn't
really make sense in non-linewise Visual mode.

Fix #28287
2024-04-15 03:43:33 +08:00
Christian Clason
4ca6e08327 vim-patch:9.1.0318: filetype: translate shell config files are not recognized
Problem:  filetype: translate shell config files are not recognized
Solution: Detect 'init.trans', 'translate-shell' and '.trans' files as
          clojure (Wu, Zhenyu)

See: https://github.com/soimort/translate-shell/wiki/Configuration

closes: vim/vim#14499

4b5cd7257e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
Christian Clason
391200f198 vim-patch:9.1.0317: filetype: matplotlibrc files are not recognized
Problem:  filetype: matplotlibrc files are not recognized
Solution: Detect 'matplotlibrc' file as yaml filetype
          (Wu, Zhenyu)

See: https://matplotlib.org/stable/users/explain/customizing.html#the-matplotlibrc-file

closes: vim/vim#14501

55d4f3c006

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
Christian Clason
737091d234 vim-patch:9.1.0316: filetype: some sh and confini files not recognized
Problem:  filetype: some sh and confini files not recognized
Solution: Detect neofetch, '.xprofile', XDG-User-Dirs files,
          paru and makepkg config files
          (Wu, Zhenyu)

See:
- https://github.com/dylanaraps/neofetch/wiki/Customizing-Info#config-file-location
- https://www.freedesktop.org/wiki/Software/xdg-user-dirs/

closes: vim/vim#14505

5a9f7e6750

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
Christian Clason
420f130223 vim-patch:9.1.0315: filetype: a few more dosini files are not recognized
Problem:  filetype: a few more dosini files are not recognized
Solution: Detect wakatime, reply config files, flatpak, nfs config files
          and a few more python tools as dosini (or toml)
          (Wu, Zhenyu)

Refer:
- https://packaging.python.org/en/latest/specifications/pypirc/
- https://jorisroovers.com/gitlint/latest/configuration/
- https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#command-line-options
- https://docs.bpython-interpreter.org/en/latest/configuration.html
- https://mypy.readthedocs.io/en/stable/config_file.html#the-mypy-configuration-file
- https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
- https://github.com/wakatime/wakatime-cli?tab=readme-ov-file#usage
- https://metacpan.org/dist/Reply/view/bin/reply#-cfg-~/.replyrc

close: vim/vim#14512

0881329d12

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
zeertzjq
a928228355
vim-patch:ce06493aeb3d (#28321)
runtime(vim): Update base-syntax, add legacy header folding

Allow for syntax-based folding of Vim9 script legacy header regions.

This is enabled with the "H" flag of the g:vimsyn_folding config variable.

closes: vim/vim#14530

ce06493aeb

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-14 07:35:08 +08:00
Christian Clason
b87212e669 vim-patch:5392970921ab
runtime(i3config): Line continuation is not detected for 'set' command (vim/vim#14531)

Problem:  Valid i3config syntax is highlighted as error.
Solution: Skip over line-breaks correctly.

5392970921

Co-authored-by: julio-b <julio.bacel@gmail.com>
2024-04-13 22:41:51 +02:00
Christian Clason
ee18c26f26 vim-patch:122d06858568
runtime(go): fix highlighting import string followed by some comment (vim/vim#14538)

122d068585

Co-authored-by: Linda_pp <rhysd@users.noreply.github.com>
2024-04-13 22:41:51 +02:00
Jaehwang Jung
328a237351
fix(defaults): auto-close terminal for &shell with args (#28276)
Problem:
The `:terminal` auto-close logic does not support `&shell` that has
arguments, e.g., `/bin/bash -O globstar`.

Solution:
Join `argv` and match `&shell`. This is not perfect since `&shell` may
contain irregular spaces and quotes, but it seems to be good enough.
2024-04-13 19:41:59 +08:00
zeertzjq
ab1203b2eb vim-patch:0549c503ba20
runtime(dts): include ftplugin support (vim/vim#14522)

0549c503ba

Co-authored-by: wzy <32936898+Freed-Wu@users.noreply.github.com>
2024-04-13 17:28:55 +08:00
zeertzjq
3b639222ff vim-patch:159dc0fcf950
runtime(kconfig): add include to ftplugin (vim/vim#14524)

related: vim/vim#14521

159dc0fcf9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-13 17:28:39 +08:00
zeertzjq
355c149ba0
vim-patch:9.1.0311: filetype: Some config files are not recognized (#28311)
Problem:  Some config files are not recognized
Solution: Add some patterns for chktex, ripgreprc and ctags config
          files.

See: https://www.nongnu.org/chktex/
See: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file
See: https://docs.ctags.io/en/latest/option-file.html#order-of-loading-option-files

closes: vim/vim#14506

a1dcd76ce7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-13 09:59:53 +08:00
dundargoc
66220d164a revert: "feat(health): fold successful healthchecks #22866"
This reverts commit 4382d2ed56.

The story for this feature was left in an incomplete state. It was never
the intention to unilaterally fold all information, only the ones that
did not contain relevant information. This feature does more harm than
good in its incomplete state.
2024-04-13 01:18:40 +02:00
zeertzjq
a629978cb6
vim-patch:9.1.0305: filetype: some history files are not recognized (#28300)
Problem:  filetype: some history files are not recognized
Solution: Add some history patterns to filetype.vim
          (Wu, Zhenyu)

closes: vim/vim#14513

da70feabea

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 18:08:54 +08:00
zeertzjq
8c112a8235 vim-patch:9.1.0307: filetype: texdoc config files is not recognized
Problem:  filetype: texdoc config files is not recognized
Solution: Detect 'texdoc.cnf' as conf filetype
          (Wu, Zhenyu)

See: https://github.com/TeX-Live/texdoc/blob/master/texdoc.cnf

closes: vim/vim#14507

7fdbd1bb58

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:22:16 +08:00
zeertzjq
be7d8ff0e4 vim-patch:9.1.0306: filetype: x11vnc config file is not recognized
Problem:  filetype: x11vnc config file is not recognized
Solution: Detect '.x11vncrc' as conf filetype
          (Wu, Zhenyu)

See: https://linux.die.net/man/1/x11vnc

closes: vim/vim#14511

58ce78ad43

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:21:28 +08:00
zeertzjq
7334e9055b vim-patch:9.1.0295: filetype: pip config files are not recognized
Problem:  filetype: pip config files are not recognized
Solution: detect pip.conf as dosini filetype
          (Wu, Zhenyu)

closes: vim/vim#14448

d2b95b8446

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:19:10 +08:00
zeertzjq
60ced890f3 vim-patch:9.1.0293: filetype: lxqt config files are not recognized
Problem:  filetype: lxqt config files are not recognized
Solution: Detect {lxqt,screengrab}/*.conf files as dosini,
          fix failing filetype test for */tex/latex/**.cfg
          (Wu, Zhenyu)

closes: vim/vim#14450

41208884b8

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:17:39 +08:00
zeertzjq
b0ded42680 vim-patch:9.1.0292: filetype: XDG mimeapps.list file is not recognized
Problem:  filetype: XDG mimeapps.list file is not recognized
Solution: Detect mimeapps.list as dosini filetype
          (Wu, Zhenyu)

Refer: https://wiki.archlinux.org/title/XDG_MIME_Applications#Format

closes: vim/vim#14451

efd752ec38

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:15:44 +08:00
zeertzjq
07c5969aa9 vim-patch:9.1.0291: filetype: libreoffice config files are not recognized
Problem:  filetype: libreoffice config files are not recognized
Solution: Detect Libreoffice config fils as xml/dosini
          (Wu, Zhenyu)

closes: vim/vim#14453

73c89bcf79

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:14:43 +08:00
zeertzjq
611cc7de43
vim-patch:9.1.0304: filetype: cgdb config file is not recognized (#28294)
Problem:  filetype: cgdb config file is not recognized
Solution: Detect cgdbrc files as cgdbrc filetype
          (Wu, Zhenyu)

closes: vim/vim#14458

1492fe6903

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:07:24 +08:00
zeertzjq
e4fb3e2007
vim-patch:9.1.0303: filetype: some protocol buffer files not recognized (#28293)
Problem:  filetype: some protocol buffer files not recognized
Solution: Detect '*.textproto', '*.textpb', '*.txtpb' as pbtxt files
          (Bruno Belanyi)

See: https://protobuf.dev/reference/protobuf/textformat-spec/#text-format-files

closes: vim/vim#14463

e54a8e7c73

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-04-12 17:06:21 +08:00
zeertzjq
a93a045e63
vim-patch:9.1.0302: filetype: blueprint files are not recognized (#28292)
Problem:  filetype: blueprint files are not recognized
Solution: Detect '*.bp' files as blueprint files, add
          a minimal filetype plugin (Bruno Belanyi)

See: https://source.android.com/docs/setup/build

closes: vim/vim#14488

6be7ef5bc7

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-04-12 17:05:11 +08:00
zeertzjq
da3059b00f
vim-patch:9.1.0290: filetype: xilinx files are not recognized (#28295)
Problem:  filetype: xilinx files are not recognized
Solution: Add a few xilinx specific file patterns,
          inspect lpr files for being xml/pascal
          (Wu, Zhenyu)

closes: vim/vim#14454

614691ceef

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:03:45 +08:00