Commit Graph

8313 Commits

Author SHA1 Message Date
Christian Clason
eb60cd74fb
build(deps)!: bump tree-sitter to HEAD, wasmtime to v29.0.1 (#32200)
Breaking change: `ts_node_child_containing_descendant()` was removed

Breaking change: tree-sitter 0.25 (HEAD) required
2025-01-27 16:16:06 +01:00
Christian Clason
21aed725d2 vim-patch:db23436: runtime(asm): add byte directives to syntax script
closes: vim/vim#16523

db23436b92

Co-authored-by: Nir Lichtman <nir@lichtman.org>
2025-01-27 08:28:18 +01:00
Maria José Solano
1759b7844a
feat(diagnostic): virtual_lines #31959 2025-01-26 15:33:03 -08:00
glepnir
d84a95da7e
feat(api): nvim_get_autocmds filter by id#31549
Problem:
nvim_get_autocmds cannot filter by id.

Solution:
Support it.
2025-01-26 15:28:33 -08:00
Christian Clason
b8e947ed4e vim-patch:fb49e3c: runtime(filetype): commit 99181205c5f8284a3 breaks V lang detection
so make the regex more strict and have it check for a parenthesis.

See:
https://github.com/vlang/v/blob/master/examples/submodule/mymodules/submodule/sub_functions.v

related: vim/vim#16513

fb49e3cde7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-25 23:56:18 +01:00
Christian Clason
974a3f7a43 vim-patch:9918120: runtime(filetype): Improve Verilog detection by checking for modules definition
While at it, also increase the maximum number of lines to check to 500.

fixes: vim/vim#16513

99181205c5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-25 23:56:18 +01:00
Christian Clason
e3e1c1e765 vim-patch:509a8d5: runtime(just): fix typo in syntax file
closes: vim/vim#16515

509a8d58f9

Co-authored-by: Peter Benjamin <petermbenjamin@gmail.com>
2025-01-25 16:35:16 +01:00
zeertzjq
63aa167f94 vim-patch:9.1.1049: insert-completed items are always sorted
Problem:  insert-completed items are always sorted, although the LSP
          spec[1] standard defines sortText in the returned
          completionitem list. This means that the server has sorted the
          results. When fuzzy is enabled, this will break the server's
          sorting results.
Solution: disable sorting of candidates when "nosort" is set in
          'completeopt'

[1]
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem

closes: vim/vim#16501

f400a0cc41

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-25 22:39:37 +08:00
georgev93
931ee5591f
feat(extmarks): virtual text can be right-aligned, truncated #31921
Problem: Right aligned virtual text can cover up buffer text if virtual
text is too long

Solution: An additional option for `virt_text_pos` called
`eol_right_align` has been added to truncate virtual text if it would
have otherwise covered up buffer text. This ensures the virtual text
extends no further left than EOL.
2025-01-24 19:57:45 -08:00
Christian Clason
3702bcb139 ci(tests): add arm64 runner
Problem: Linux `aarch64`/`arm64` builds are not tested.

Solution: Add `ubuntu-arm` runners to test matrix (using
`RelWithDebInfo` build).
2025-01-24 10:34:18 +01:00
Evgeni Chasnovski
a450fda4ed fix(lsp): prefer on_list over loclist in default handler
Problem: setting `loclist = true` makes `on_list` being ignored. This
  was not a problem before, but with `vim.lsp.buf.document_symbol` using
  `loclist = true` as default it is needed to explicitly pass `loclist =
  false` in order to use custom `on_list`.

Solution: prefer `on_list` over `loclist` and document the latter as
  taking effect only in the default handler.
2025-01-23 17:04:23 +01:00
Luuk van Baal
34d808b73c feat(api): combined highlights in nvim_eval_statusline()
Problem:  Combined highlighting was not applied to nvim_eval_statusline(),
          and 'statuscolumn' sign segment/numhl highlights.
Solution: Add an additional `groups` element to the return value of
          `nvim_eval_statusline()->highlights`. This is an array of stacked
          highlight groups (highest priority last). Also resolve combined
          highlights for the 'statuscolumn' sign segment/numhl highlights.
          Expose/synchronize some drawline.c logic that is now mimicked in
          three different places.
2025-01-23 10:56:25 +01:00
Christian Clason
8634bd46b2 vim-patch:9.1.1042: filetype: just files are not recognized
Problem:  filetype: just files are not recognized
Solution: adjust filetype detection pattern, detect just shebang line,
          include just ftplugin, indent and syntax plugin
          (Peter Benjamin)

closes: vim/vim#16466

72755b3c8e

Co-authored-by: Peter Benjamin <petermbenjamin@gmail.com>
2025-01-23 09:42:20 +01:00
zeertzjq
28998e1f8a
vim-patch:9.1.1045: filetype: N-Tripels and TriG files are not recognized (#32170)
Problem:  filetype: N-Tripels and TriG files are not recognized
Solution: detect '*.nt' files as ntriples filetype and '*.trig' files
          as trig filetype (Gordian Dziwis)

closes: vim/vim#16493

c04334c33f

Co-authored-by: Gordian Dziwis <gordian@dziw.is>
2025-01-23 16:33:41 +08:00
phanium
4c9f3689a1 fix(checkhealth): failed if 'lua' in plugin name 2025-01-23 07:46:40 +00:00
Siddhant Agarwal
af0ef2ac9d
feat(lua): vim.hl.range() "timeout" #32012
Problem:
`vim.hl.on_yank()` has a "timeout" behavior but this is not available for
`vim.hl.range()`.

Solution:
Add `timeout` arg to `vim.hl.range()`.
2025-01-22 07:46:24 -08:00
jdrouhard
22fd52325b
fix(inspector): update semantic token namespace (#32157)
This updates the extmark namespace to search for when filtering out
semantic tokens to match the new namespace style recently introduced.
2025-01-22 21:02:30 +08:00
bfredl
d7aba51d39
Merge pull request #32098 from bfredl/multihl_group
feat(extmark): stack multiple highlight groups in `hl_group`
2025-01-21 12:32:20 +01:00
bfredl
4cced601c8 feat(extmark): stack multiple highlight groups in hl_group
This has been possible in the "backend" for a while but
API was missing.

Followup: we will need a `details2=true` mode for `nvim_get_hl_id_by_name`
to return information in a way forward compatible with even further
enhancements.
2025-01-21 12:00:24 +01:00
zeertzjq
05435bf105
vim-patch:c273f1a: runtime(vim): Update base-syntax, match ternary and falsy operators (#32132)
fixes: vim/vim#14423
fixes: vim/vim#16227
closes: vim/vim#16484

c273f1ac77

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-21 00:10:14 +00:00
Christian Clason
855a2a75e6 vim-patch:4335fcf: runtime(kconfig): updated ftplugin and syntax script
4335fcfed1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-21 00:16:24 +01:00
Konrad Malik
f50f86b9ff fix(treesitter): compute folds on_changedtree only if not nil 2025-01-20 22:32:45 +00:00
bfredl
20e16c1c49
Merge pull request #32099 from bfredl/no_bufhl
feat(api): deprecate nvim_buf_add_highlight()
2025-01-20 15:42:56 +01:00
Donatas
5b1136a99c
feat(inccommand): preview 'nomodifiable' buffers #32034
Problem:
Incremental preview is not allowed on 'nomodifiable' buffers.

Solution:
- Allow preview on 'nomodifiable' buffers.
- Restore the 'modifiable' option in case the preview function changes it.
2025-01-20 06:40:26 -08:00
Konrad Malik
ded15ca8c2
fix: completion.enable(false,...) deletes invalid augroup #32121
Problem:

    vim.lsp.completion.enable(true, client.id, bufnr)
    vim.lsp.completion.enable(false, client.id, bufnr)

    Error detected while processing LspDetach Autocommands for "*":
    Error executing lua callback: …/lsp/completion.lua:701: Vim:E367: No such group: "vim/lsp/completion-22"
    stack traceback:
            [C]: in function 'nvim_del_augroup_by_name'
            …/lsp/completion.lua:701: in function 'disable_completions'
            …/lsp/completion.lua:724: in function 'enable'

Solution:
Delete the correct augroup.
2025-01-20 06:10:00 -08:00
Guilherme Soares
8a236c242a
fix(lsp): set floating window filetype after setup #32112
Problem:
The filetype for the floating window buffer is being set before its context is fully initialized.
This results in `FileType` events not receiving the correct context.

Solution:
Set the filetype after the floating preview window and its buffer variables are
fully configured to ensure proper context is provided.
2025-01-20 05:00:13 -08:00
bfredl
19b25f3fea feat(api): deprecate nvim_buf_add_highlight()
This was kept for a while as it was a useful short hand and initially
matched what highlights what actually properly implemented. But now
|vim.hl.range()| is a better high-level shorthand with full support for
native multi-line ranges.
2025-01-20 13:59:29 +01:00
Jaehwang Jung
27c8806953
docs(treesitter): expose LanguageTree:parent() #32108
Plugins may want to climb up the LanguageTree.

Also add missing type annotations for other methods.
2025-01-20 04:17:36 -08:00
Christian Clason
5b025b499e vim-patch:9.1.1030: filetype: setting bash filetype is backwards incompatible
Problem:  filetype: setting bash filetype is backwards incompatible
Solution: revert patch v9.1.0965, detect bash scripts again as sh
          filetype

This reverts commit b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721.

related: vim/vim#16309

727c567a09

Co-authored-by: Christian Brabandt <cb@256bit.org>

vim-patch:9.1.1033: tests: shaderslang was removed from test_filetype erroneously

Problem:  tests: shaderslang was removed from test_filetype erroneously
          (Christian Clason, after v9.1.1030)
Solution: restore the test

1d2867df0c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-20 08:20:36 +01:00
Christian Clason
b172dd57fa vim-patch:2cb8246: runtime(tex): add texEmphStyle to texMatchGroup in syntax script
fixes: vim/vim#16228

2cb8246eb9

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Github User JordL
2025-01-20 08:20:24 +01:00
Christian Clason
4dc2e016da vim-patch:d402ba8: runtime(netrw): upstream snapshot of v175
Relevant commits:
- release: netrw v175
- fix: prevent netrw to load into the built-in terminal
- fix: restore correctly cpo settings
- fix(docs): mispelled original authors name
- chore: move viml files to new formatting standard

fixes: vim/vim#16463
closes: vim/vim#16465

d402ba81e2

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2025-01-20 08:20:11 +01:00
Christian Clason
de83cc5842 fix(netrw): re-add missing comment marker in syntax file 2025-01-20 08:20:11 +01:00
Mathias Fussenegger
5f527f24f0 fix(lsp): don't use completion filterText if prefix is empty
Follow up to https://github.com/neovim/neovim/pull/32072

If there is no prefix (e.g. at the start of word boundary or a line), it
always used the `filterText` because the `match` function always
returned false.
2025-01-19 22:11:20 +01:00
Yochem van Rosmalen
d56ba71af1
fix(lsp): document_symbol uses loclist by default #32070
Problem: Not able to open document symbols for different buffers

Solution: Use the location list as default.

To switch back to previous behavior (qflist):

  vim.lsp.buf.document_symbol({ loclist = false })

Fixes: #31832
2025-01-19 13:08:10 -08:00
Jaehwang Jung
6696ea7f10 fix(treesitter): clean up parsing queue 2025-01-19 15:53:17 +01:00
zeertzjq
ee54069d1d
vim-patch:8dec6c2: runtime(vim): Update base-syntax, fix is/isnot operator matching (#32100)
- Match is? and isnot? operators.
- Limit other comparison operators to one match modifier rather than
  two.

closes: vim/vim#16482

8dec6c2e6c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-19 22:14:52 +08:00
Gregory Anders
51ccd12b3d
fix(diagnostic)!: make virtual text handler opt-in (#32079)
Making this opt-out (on by default) was the wrong choice from the
beginning. It is too visually noisy to be enabled by default.

BREAKING CHANGE: Users must opt-in to the diagnostic virtual text
handler by adding

  vim.diagnostic.config({ virtual_text = true })

to their config.
2025-01-18 07:43:21 -06:00
Christian Clason
954d4969c9 vim-patch:e064051: runtime(c): add new constexpr keyword to syntax file (C23)
closes: vim/vim#16471

e06405181a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-18 11:54:53 +01:00
Christian Clason
7d04ebd43c vim-patch:54cb514: runtime(sh): update syntax script
- remove duplicated keywords
- add bash coproc and COPROC_PID keywords

54cb514c9a

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-01-18 11:48:35 +01:00
Christian Clason
e962167245 vim-patch:9cfdabb: runtime(netrw): change netrw maintainer
Dr. Chip retired some time ago and is no longer maintaining the netrw
plugin. However as a runtime plugin distributed by Vim, it important to
maintain the netrw plugin in the future and fix bugs as they are
reported.

So, split out the netrw plugin as an additional package, however include
some stubs to make sure the plugin is still loaded by default and the
documentation is accessible as well.

closes: vim/vim#16368

9cfdabb074

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2025-01-18 09:49:35 +01:00
Christian Clason
136cb642a0 vim-patch:c2a967a: runtime(c): Update syntax and ftplugin files
- highlight more C keywords, including some from C23

Conditionally highlight C23 features:
- #embed, #elifdef and #elifndef preprocessor directives
- predefined macros
- UTF-8 character constants
- binary integer constants, _BitInt literals, and digit separators
- nullptr_t type and associated constant
- decimal real floating-point, bit precise and char types
- typeof operators

Matchit:
- update for new preprocessor directives

fixes: vim/vim#13667
fixes: vim/vim#13679
closes: vim/vim#12984

c2a967a1b9

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Albin Ahlbäck <albin.ahlback@gmail.com>
2025-01-18 08:45:43 +01:00
Yochem van Rosmalen
c6cc937512
docs: change augroup names to new convention #32061
Ref: 09e01437c9
2025-01-17 14:56:30 -08:00
Mathias Fussenegger
b9e6fa7ec8 fix(lsp): use filterText as word if textEdit/label doesn't match
Problem:

With language servers like lemminx, completing xml tags like `<mo` first
shows the right candidates (`modules`) but after typing `d` the
candidates disappear.

This is because the server returns:

    [...]
    filterText = "<module",
    label = "module",
    textEdit = {
      newText = "<module>$1</module>$0",

Which resulted in `module` being used as `word`, and `module` doesn't
match the prefix `<mo`. Typing `d` causes the `complete()` filtering
mechanism to kick in and remove the entry.

Solution:

Use `<module` from the `filterText` as `word` if the textEdit/label
heuristic doesn't match.
2025-01-17 18:34:58 +01:00
Christian Clason
3530182ba4 vim-patch:9.1.1026: filetype: swc configuration files are not recognized
Problem:  filetype: swc configuration files are not recognized
Solution: detect .swcrc files as json filetype (Marces Engel)

References:
https://swc.rs/docs/configuration/swcrc

closes: vim/vim#16462

3a738fccaa

Co-authored-by: Marces Engel <marces@facemurphy.com>
2025-01-17 16:45:59 +01:00
Luuk van Baal
7ce27381fb fix(messages): lsp window/showMessage is not an error
Ref https://github.com/neovim/neovim/discussions/32015
2025-01-17 08:40:50 +01:00
zeertzjq
ac3859a441
vim-patch:a234a46: runtime(doc): fix typo in usr_02.txt (#32063)
fixes: vim/vim#16455

a234a46651

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-17 09:09:47 +08:00
zeertzjq
0d3a8e8c1a
vim-patch:9.1.1020: no way to get current selected item in a async context (#32056)
Problem:  no way to get current selected item in a async context
Solution: add completed flag to show the entries of currently selected
          index item (glepnir)

closes: vim/vim#16451

037b028a22

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-17 08:38:58 +08:00
Gregory Anders
bf098c12e3
Merge pull request #32038 from gpanders/push-nsrttwwnsqvm
feat(terminal): add support for kitty keyboard protocol
2025-01-16 18:33:22 -06:00
Gregory Anders
6f0bde11cc feat(terminal): add support for kitty keyboard protocol
This commit adds basic support for the kitty keyboard protocol to
Neovim's builtin terminal. For now only the first mode ("Disambiguate
escape codes") is supported.
2025-01-16 16:41:08 -06:00
Lewis Russell
fb564ddff0
refactor(options): generic expand and did_set callbacks (#32011)
* refactor(options): generic expand and did_set callbacks

Problem:

Many options have similar callbacks to check the values are valid.

Solution:

Generalize these callbacks into a single function that reads the option
table.

* refactor: gen_options.lua

refactor: gen_options.lua - inline get_cond

* refactor(options): use a simpler format for the common default
2025-01-16 20:53:17 +00:00
Christian Clason
524be56042
vim-patch:9.1.1019: filetype: fd ignore files are not recognized (#32042)
Problem:  filetype: fd ignore files are not recognized
Solution: detect .fdignore files as gitignore filetype

closes: vim/vim#16444

3058087f6f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-16 07:34:25 +08:00
Evgeni Chasnovski
09bcb31068
fix(docs): replace yxx mappings with g== #31947
Problem:
`yx` uses "y" prefix, which shadows a builtin operator.

Solution:
Use `g=` (in the form of `g==` currently), drawing from precedent of
CTRL-= and 'tpope/vim-scriptease'.
2025-01-15 02:36:00 -08:00
Justin M. Keyes
9552fe7ef9
Merge #32013 from luukvbaal/shellkind 2025-01-15 02:23:44 -08:00
Justin M. Keyes
3ee63edc1b
Merge #32001 from MariaSolOs/consistent-namespaces 2025-01-15 02:01:44 -08:00
Andrew Braxton
0a7e4e9e5f
fix(lsp): vim.lsp.enable(...,false) does not disable #32002
Problem:
Per the documentation, passing `false` as the `enable` parameter of
`vim.lsp.enable()` should disable the given LSP(s), but it does not work
due to a logic error.

Specifically, `enable == false and nil or {}` will always evaluate to
`{}` because `nil` is falsy.

Solution:
Correct the conditional statement.
2025-01-15 01:58:36 -08:00
Luuk van Baal
5bae80899d feat(messages): add :!cmd shell message kinds
Also print stderr error messages with ErrorMsg highlight group.
2025-01-15 10:51:52 +01:00
Christian Clason
bc69f27237 vim-patch:045564d: runtime(colors): Update colorschemes, include new unokai colorscheme
- new unokai colorscheme (similar/inspired by monokai)
- the rest: add explicit PopupSelected link to PmenuSel

closes: vim/vim#16443

045564d0a7

Co-authored-by: Maxim Kim <habamax@gmail.com>
2025-01-15 09:48:55 +01:00
Maria José Solano
575f4bc7d5 docs: document namespace/augroup convention 2025-01-14 21:25:25 -08:00
Maria José Solano
09e01437c9 refactor: use nvim.foo.bar format for autocommand groups 2025-01-14 21:25:25 -08:00
Maria José Solano
850084b519 refactor: use nvim.foo.bar format for namespaces 2025-01-14 19:55:29 -08:00
Mike
611ef35491
feat(vim.fs): find(), dir() can "follow" symlinks #31551
Problem:
vim.fs.dir(), vim.fs.find() do not follow symlinks.

Solution:
- Add "follow" flag.
- Enable it by default.
2025-01-14 16:39:17 -08:00
Gregory Anders
e8a6c1b021
fix(lsp): schedule call to vim.lsp.start for async root_dir (#31998)
When `root_dir` is a function it can (and often will) call the provided
callback function in a fast API context (e.g. in the `on_exit` handler
of `vim.system`). When the callback function is executed we should
ensure that it runs vim.lsp.start on the main event loop.
2025-01-14 08:19:54 -06:00
Gregory Anders
f1c45fc7a4
feat(terminal): support theme update notifications (DEC mode 2031) (#31999) 2025-01-14 08:18:59 -06:00
luukvbaal
25d8c3a5ad
feat(api): nvim_open_win() relative to tabline and laststatus #32006
Problem:  Anchoring a floating window to the tabline and laststatus is
          cumbersome; requiring autocommands and looping over all
          windows/tabpages.
Solution: Add new "tabline" and "laststatus" options to the `relative`
          field of nvim_open_win() to place a window relative to.
2025-01-14 05:02:46 -08:00
Christian Clason
e8ddb7a469 vim-patch:30377e0: runtime(lyrics): support milliseconds in syntax script
The following tool creates LRC files using three fractional digits after
the seconds (i.e. milliseconds).

References:
https://github.com/magic-akari/lrc-maker
https://lrc-maker.github.io/

closes: vim/vim#16436

30377e0fe0

Co-authored-by: Denilson Sá Maia <denilsonsa@gmail.com>
2025-01-14 13:23:02 +01:00
zeertzjq
69ad6b12ec
vim-patch:9.1.1010: filetype: VisualCode setting file not recognized (#32003)
Problem:  filetype: VisualCode setting file not recognized
Solution: detect json files in VSCode config directory as jsonc filetype
          (Konfekt)

closes: vim/vim#16400

c200f53cbb

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-01-14 18:55:06 +08:00
Riley Bruins
b192d58284 perf(treesitter): calculate folds asynchronously
**Problem:** The treesitter `foldexpr` runs synchronous parses to
calculate fold levels, which eliminates async parsing performance in the
highlighter.

**Solution:** Migrate the `foldexpr` to also calculate and apply fold
levels asynchronously.
2025-01-14 09:30:43 +00:00
Xuyuan Pang
a4f575abd8
fix(lsp): minimum height for floating popup #31990
Problem:
The floating window for hover and signature help always cuts off a few lines,
because the `_make_floating_popup_size` function counts empty lines as having
zero height.

Solution:
Ensure the height is at least 1.
2025-01-13 15:17:23 -08:00
Lewis Russell
34e2185022 fix(options): better handling of empty values
Problem:

Whether an option is allowed to be empty isn't well defined and
isn't properly checked.

Solution:

- For non-list string options, explicitly check the option value
  if it is empty.
- Annotate non-list string options that can accept an empty value.
  - Adjust command completion to ignore the empty value.
- Render values in Lua meta files
2025-01-13 16:58:25 +00:00
luukvbaal
cb7b4e2962
feat(messages): "verbose" message kind #31991 2025-01-13 04:59:34 -08:00
dundargoc
0631492f9c feat: add vim.fs.relpath
This is needed to replace the nvim-lspconfig function is_descendant that
some lspconfg configurations still use.
2025-01-13 13:14:52 +01:00
Riley Bruins
bd4ca22d03 feat(treesitter)!: don't parse tree in get_parser() or start()
**Problem:** `vim.treesitter.get_parser()` and `vim.treesitter.start()`
both parse the tree before returning it. This is problematic because if
this is a sync parse, it will stall the editor on large files. If it is
an async parse, the functions return stale trees.

**Solution:** Remove this parsing side effect and leave it to the user
to parse the returned trees, either synchronously or asynchronously.
2025-01-12 08:10:49 -08:00
Riley Bruins
45e606b1fd feat(treesitter): async parsing
**Problem:** Parsing can be slow for large files, and it is a blocking
operation which can be disruptive and annoying.

**Solution:** Provide a function for asynchronous parsing, which accepts
a callback to be run after parsing completes.

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
Co-authored-by: VanaIgr <vanaigranov@gmail.com>
2025-01-12 08:10:47 -08:00
Riley Bruins
3fdc430241 perf(treesitter): cache queries strongly
**Problem:** Query parsing uses a weak cache which is invalidated
frequently

**Solution:** Make the cache strong, and invalidate it manually when
necessary (that is, when `rtp` is changed or `query.set()` is called)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2025-01-12 16:44:24 +01:00
Christian Clason
bf58b757c4 vim-patch:9.1.1007: filetype: various ignore are not recognized
Problem:  filetype: various ignore are not recognized
Solution: detect rg/docker/npm/vvsce ignore files as 'gitgnore' filetype
          (Wu, Zhenyu)

Not only prettier, but many programs also support ignore files (like rg,
docker, npm, vscode). So use the gitignore filetype for them due to same syntax

closes: vim/vim#16428

8cbe2e0a0a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-12 12:01:24 +01:00
zeertzjq
88dca6a835
vim-patch:partial:9598a63: runtime(doc): add package-<name> helptags for included packages (#31972)
Improve how to find the justify package

closes: vim/vim#16420

9598a6369b

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Peter Benjamin <petermbenjamin@gmail.com>
2025-01-12 07:43:58 +08:00
Gregory Anders
a119aae4d3
feat(diagnostic)!: filter diagnostics by severity before passing to handlers (#30070)
BREAKING CHANGE: This changes the list of diagnostics that are passed to
a diagnostic handler. If a handler is already filtering by severity
itself then this won't break anything, since the handler's filtering
will become a no-op. But handlers which depend on receiving the full
list of diagnostics may break.

Note that diagnostics are only filtered if the handler's configuration
has the `severity` option set. If `severity` is not set, the handler
still receives the full list of diagnostics.
2025-01-11 12:54:43 -06:00
Christian Clason
9e0d40f7e4 vim-patch:668e9f2: runtime(filetype): don't detect string interpolation as angular
fixes: vim/vim#16375

668e9f2403

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-11 11:20:19 +01:00
dundargoc
6a425e7045 docs: misc
Co-authored-by: Axel <axelhjq@gmail.com>
Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
Co-authored-by: Daiki Noda <sys9kdr@users.noreply.github.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Jean-Jacq du Plessis <1030058+jj-du-plessis@users.noreply.github.com>
Co-authored-by: Juan Giordana <juangiordana@gmail.com>
Co-authored-by: Lincoln Wallace <locnnil0@gmail.com>
Co-authored-by: Matti Hellström <hellstrom@scm.com>
Co-authored-by: Steven Locorotondo <steven.locorotondo@justeattakeaway.com>
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: ifish <fishioon@live.com>
2025-01-11 10:34:12 +01:00
zeertzjq
df45b336f5
vim-patch:695522d: runtime(vim): Update base-syntax, highlight literal string quote escape (#31957)
Match the '' escape sequence in literal strings.  These were previously
ending the current string and starting another concatenated literal
string.

closes: vim/vim#16415

695522dea3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-11 08:27:50 +08:00
Christian Clason
dcaf9a60e9 vim-patch:51754c8: runtime(editorconfig): set omnifunc to syntaxcomplete func
closes: vim/vim#16419

51754c8a49

Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
2025-01-11 00:44:06 +01:00
Guilherme Soares
aa2b44fbb0
fix(treesitter): don't return error message on success #31955
Problem:
The `vim.treesitter.language.add` function returns
a error message even when it succeeds.

Solution:
Don't return error message on success.
2025-01-10 14:46:19 -08:00
Riley Bruins
cb02c20569 refactor(treesitter.foldexpr): remove unused parse_injections parameter 2025-01-10 22:06:35 +00:00
Justin M. Keyes
0717dfbfaf
refactor(api): deprecate nvim_notify #31938
Problem:
The `nvim_notify` API (note: unrelated to `vim.notify()` Lua API) was
not given any real motivation in https://github.com/neovim/neovim/pull/13843

There are, and were, idiomatic and ergonomic alternatives already.

Solution:
Deprecate `nvim_notify`.
2025-01-10 11:42:04 -08:00
zeertzjq
b06f42b502
vim-patch:df4a7d7: runtime(tiasm): use correct syntax name tiasm in syntax script (#31942)
vim-patch:df4a7d7: runtime(tiasm):  use correct syntax name tiasm in syntax script

closes: vim/vim#16416

df4a7d7617

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-10 17:17:34 +08:00
Justin M. Keyes
7c00e0efbb
docs: misc #31867 2025-01-09 09:26:45 -08:00
Riley Bruins
0c296ab224
feat(docs): "yxx" runs Lua/Vimscript code examples #31904
`yxx` in Normal mode over a Lua or Vimscript code block section will execute the code.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-01-09 08:36:16 -08:00
Justin M. Keyes
5135a23219
Merge #31900 from luukvbaal/nvim_echo 2025-01-09 06:36:29 -08:00
Luuk van Baal
5c92b40b4b feat(api): deprecate nvim_out/err_write(ln) 2025-01-09 13:35:42 +01:00
Luuk van Baal
ead5683ff9 feat(api): add err field to nvim_echo() opts
Problem:  We want to deprecate `nvim_err_write(ln)()` but there is no
          obvious replacement (from Lua). Meanwhile we already have
          `nvim_echo()` with an `opts` argument.
Solution: Add `err` argument to `nvim_echo()` that directly maps to
          `:echoerr`.
2025-01-09 13:35:40 +01:00
zeertzjq
3f0adf90de
vim-patch:9.1.0998: filetype: TI assembly files are not recognized (#31929)
Problem:  filetype: TI assembly files are not recognized
Solution: inspect '*.sa' and assembly files and detect TI assembly
          files, include filetype plugin and syntax script for TI
          assembly files (Wu, Zhenyu)

closes: vim/vim#15827

4f73c07abf

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-09 17:30:26 +08:00
Christian Clason
d740a4274d vim-patch:8ab1819: runtime(xf86conf): add section name OutputClass to syntax script
References:
https://man.archlinux.org/man/xorg.conf.5#DESCRIPTION

closes: vim/vim#16397

8ab1819df6

Co-authored-by: Jan-Arvid Harrach <jharrach@tutanota.com>
2025-01-09 08:07:30 +01:00
zeertzjq
0d469b697e
vim-patch:1718e7d: runtime(vim): Update base-syntax, improve ex-bang matching (#31922)
Always match ex-bang explicitly rather than incidentally as the ! operator.

fixes: vim/vim#16221
closes: vim/vim#16410

1718e7d07e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-09 00:40:50 +00:00
notomo
5b9518b436
fix(api): nvim_set_decoration_provider callback return type #31912
Problem: incorrect return type doc causes luals `Annotations specify that at most 0 return value(s) are required, found 1 returned here instead.` diagnosis

Solution: correct return type doc
2025-01-08 04:37:29 -08:00
Christian Clason
561580aba5 vim-patch:9.1.0995: filetype: shaderslang files are not detected
Problem:  filetype: shaderslang files are not detected
Solution: detect '*.slang' files as shaderslang filetype,
          include a filetype and syntax script (mtvare6)

Reference:
https://shader-slang.com/

closes: vim/vim#16387

616219f684

Co-authored-by: mtvare6 <mtvare6@proton.me>
2025-01-08 10:32:45 +01:00
glepnir
b12b91c274
feat(health): show :checkhealth in floating window #31086
Problem: health can not shown in a floating window
Solution: add g:health variable
2025-01-07 08:09:01 -08:00
Riley Bruins
d9ee0d2984 perf(treesitter): don't fetch parser for each fold line
**Problem:** The treesitter `foldexpr` calls `get_parser()` for each
line in the buffer when calculating folds. This can be incredibly slow
for buffers where a parser cannot be found (because the result is not
cached), and exponentially more so when the user has many
`runtimepath`s.

**Solution:** Only fetch the parser when it is needed; that is, only
when initializing fold data for a buffer.

Co-authored-by: Jongwook Choi <wookayin@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-01-07 16:43:45 +01:00
Christian Clason
4d94059919 vim-patch:3159b64: runtime(sh): fix typo in Last Change header
related: vim/vim#16394

3159b6494e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-07 08:03:13 +01:00
Christian Clason
b44a8ba1e7 vim-patch:cf1f555: runtime(sh): add PS0 to bashSpecialVariables in syntax script
PS0 is also a special prompt variable. (It is expanded and displayed
after it reads a command but before executing it.)

References:
https://www.gnu.org/software/bash/manual/html_node/Interactive-Shell-Behavior.html

closes: vim/vim#16394

cf1f55548d

Co-authored-by: Jon Parise <jon@indelible.org>
2025-01-07 08:03:13 +01:00
Christian Clason
a942dea157 vim-patch:7ceaa8f: runtime(vim): Remove trailing comma from match_words
fixes: vim/vim#16377 (`filetype plugin indent on` breaks matchit).
closes: vim/vim#16389

7ceaa8f3dd

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-07 08:03:13 +01:00