Commit Graph

8083 Commits

Author SHA1 Message Date
zeertzjq
4817547ec4
feat(ex_cmds): :sleep! hides the cursor while sleeping (#31493)
Problem:  :sleep! not hiding the cursor is an arbitrary difference from
          Vim without obvious justification, and Vim's behavior isn't
          easily achievable in Nvim.
Solution: Make :sleep! hide the cursor while sleeping.

Ref:
6a01b3fcc3
b5c0ade437
2024-12-07 21:42:44 +08:00
Riley Bruins
c63e49cce2
fix(treesitter): #trim! range for nodes ending at col 0 #31488
Problem:
char-wise folding for `#trim!` ranges are improperly calculated for nodes that
end at column 0, due to the way `get_node_text` works.

Solution:
Add the blank line that `get_node_text` removes for for nodes ending at column
0. Also properly set column positions when performing linewise trims.
2024-12-07 03:01:59 -08:00
Lewis Russell
5c245ec3e9 fix: remove vim.lsp._with_extend
Not used anywhere.
2024-12-07 10:08:58 +00:00
tris203
bdfba8598b fix(lsp): cancel pending requests before refreshing
Problem:
Diagnostics and inlay hints can be expensive to calculate, and we
shouldn't stack them as this can cause noticeable lag.

Solution:
Check for duplicate inflight requests and cancel them before issuing a new one.
This ensures that only the latest request is processed, improving
performance and preventing potential conflicts.
2024-12-07 10:08:33 +00:00
Maria José Solano
c2bf09ddff fix(lsp): check for configuration workspace folders when reusing clients 2024-12-07 09:43:45 +00:00
Christian Clason
9c278af7cc fix(inspect): show priority for treesitter highlights
Problem: `:Inspect` does not show priority for treesitter highlights,
leading to confusion why sometimes earlier highlights override later
highlights.

Solution: Also print priority metadata if set.
2024-12-07 10:26:24 +01:00
zeertzjq
ec94c2704f
vim-patch:9.1.0908: not possible to configure :messages (#31492)
Problem:  not possible to configure :messages
Solution: add the 'messagesopt' option (Shougo Matsushita)

closes: vim/vim#16068

51d4d84d6a

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: h_east <h.east.727@gmail.com>
2024-12-07 02:17:36 +00:00
Bartłomiej Maryńczak
517ecb85f5
feat(stdlib): vim.json.encode(...,{escape_slash:boolean}) #30561
Problem:
vim.json.encode escapes every slash in string values (for example in
file paths), and is not optional. Use-case is for preventing HTML
injections (eg. injecting `</script>` closing tag); in the context of
Nvim this is rarely useful.

Solution:
- Add a `escape_slash` flag to `vim.json.encode`.
- Defaults to `false`. (This is a "breaking" change, but more like
  a bug fix.)
2024-12-06 12:43:41 -08:00
Tristan Knight
fac96b72a5
fix(lsp): add foldingrange method support check #31463
Problem: The folding_range request method assumes that the client
supports the method

Solution: Add a capability guard to the call
2024-12-06 10:09:07 -08:00
Gregory Anders
2550b5e9bd
docs: do not escape Lua keywords #31467 2024-12-06 10:08:46 -08:00
Justin M. Keyes
ba7370a902
Merge #30085 #trim! all whitespace 2024-12-06 10:08:20 -08:00
Riley Bruins
b8c75a31e6 feat(treesitter): #trim! can trim all whitespace
This commit also implements more generic trimming, acting on all
whitespace (charwise) rather than just empty lines.

It will unblock
https://github.com/nvim-treesitter/nvim-treesitter/pull/3442 and allow
for properly concealing markdown bullet markers regardless of indent
width, e.g.
2024-12-06 08:36:08 -08:00
Micah Halter
e8e3b443f8
feat(defaults): disable 'foldcolumn' in terminal buffers (#31480) 2024-12-06 10:19:24 -06:00
zeertzjq
1077843b9b
fix(filetype): make filetype detection work with :doautocmd (#31470) 2024-12-06 20:57:21 +08:00
Brian A. Weston
367182abd5
docs: delineate blocks/list items #30973
Problem: Paragraph below bulleted list was joined to last list item instead of dropping below as expected. Same with "Notes:" paragraph below it.

Solution: Added necessary newlines.
2024-12-06 04:48:50 -08:00
zeertzjq
e9f4ceeb74
fix(events): don't expand args.file for Lua callback (#31473)
Problem:  In an autocommand Lua callback whether `args.file` is expanded
          depends on whether `expand('<afile>')` has been called.
Solution: Always use the unexpanded file name for `args.file`.

Related to #31306 and vim/vim#16106. This doesn't provide `sfname`, but
at least makes `args.file` have a consistent value.
2024-12-06 20:01:28 +08:00
Christian Clason
812d029702 vim-patch:9.1.0906: filetype: Nvidia PTX files are not recognized
Problem:  filetype: Nvidia PTX files are not recognized
Solution: detect '*.ptx' files as ptx filetype (Yinzuo Jiang)

Reference: https://docs.nvidia.com/cuda/parallel-thread-execution/

closes: vim/vim#16171

bdb5f85a51

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-12-06 09:40:44 +01:00
zeertzjq
bf5c1346c5
vim-patch:ea0e41a: runtime(doc): make tag alignment more consistent in filetype.txt (#31459)
closes: vim/vim#16169

ea0e41a115

Omit Lua folding.

N/A patch:
vim-patch:fdfcce5: runtime(lua): add optional lua function folding
2024-12-06 07:22:44 +08:00
Jeremy Fleischman
fd902b1cb2
fix(diagnostic): only store quickfix id when creating a new one #31466
The old code would always update `_qf_id` with the current quickfix,
even if you're currently looking at a completely different,
non-diagnostics quickfix list. This completely defeats the intent of
<https://github.com/neovim/neovim/pull/30868>, whoops!
2024-12-05 13:59:33 -08:00
Justin M. Keyes
12901447cb
docs: graduate intro.txt to "flow layout" #31462
- move credits and backers to credits.txt
2024-12-05 07:18:27 -08:00
vanaigr
3abd7ed4a4 perf: consider only active decorations when drawing lines 2024-12-05 08:45:22 -06:00
Justin M. Keyes
845e563421
Merge #31451 docs 2024-12-05 04:02:34 -08:00
zeertzjq
8323398bc6
fix(defaults): don't replace keycodes in Visual search mappings (#31460)
Also remove "silent" to be more consistent with Normal mode search.
2024-12-05 19:03:58 +08:00
glepnir
2f5e7cbac4
vim-patch:9.1.0905: Missing information in CompleteDone event (#31455)
Problem:  Missing information in CompleteDone event
Solution: add complete_word and complete_type to v:event dict
          (glepnir)

closes: vim/vim#16153

1c5a120a70
2024-12-05 17:49:39 +08:00
Justin M. Keyes
5413c6475e docs: graduate gui.txt to "flow layout" 2024-12-05 01:38:44 +01:00
Gregory Anders
0a15cd2500
misc: keep deprecated vim.loader.disable stub (#31450)
Transitional stub to minimize breaking change pain, to be removed after
0.11 release.
2024-12-04 10:17:46 -06:00
Gregory Anders
52481eecf0
docs: mention new terminal defaults (#31449) 2024-12-04 10:17:19 -06:00
Jeremy Fleischman
7579af3c51
feat(diagnostic): vim.diagnostic.setqflist improvements #30868
1. Use the new "u" action to update the quickfix list so we don't lose
   our position in the quickfix list when updating it.
2. Rather than creating a new quickfix list each time, update the
   exiting one if we've already created one.
2024-12-04 07:49:57 -08:00
Justin M. Keyes
6586645d78 docs: help tags for neovim.io searches 2024-12-04 16:34:44 +01:00
Lewis Russell
734dba04d1 fix(vim.system): close pipe handles after process handle
Fixes #30846
2024-12-04 14:44:40 +00:00
Gregory Anders
56d11b494b
defaults: disable 'number', 'relativenumber', and 'signcolumn' in terminal buffers (#31443) 2024-12-04 08:40:01 -06:00
Maria José Solano
e56437cd48
feat(lsp): deprecate vim.lsp.start_client #31341
Problem:
LSP module has multiple "start" interfaces.

Solution:
- Enhance vim.lsp.start
- Deprecate vim.lsp.start_client
2024-12-04 05:14:47 -08:00
zeertzjq
b079a9d2e7
vim-patch:9.1.0902: filetype: Conda configuration files are not recognized (#31445)
Problem:  filetype: Conda configuration files are not recognized
Solution: detect '.condarc' and 'condarc' files as yaml filetype.
          (zeertzjq)

closes: vim/vim#16162

876de275cb
2024-12-04 17:49:12 +08:00
Justin M. Keyes
ae93c7f369
docs: misc, help tags for neovim.io searches #31428
Problem:
Various keywords are commonly searched-for on https://neovim.io, but
don't have help tags.

Solution:
Add help tags.

fix #31327
2024-12-03 09:44:28 -08:00
wzy
2495e7e22a
fix(clipboard): tmux clipboard depends on $TMUX #31268
Problem:
tmux clipboard not used when tmux is a daemon and $TMUX is empty.

Solution:
If `tmux list-buffers` succeeds, use tmux clipboard.
2024-12-03 05:06:54 -08:00
Gregory Anders
49d6cd1da8
docs: provide example for configuring LSP foldexpr (#31411)
Using the "supports_method" function with a client capability inside of
an LspAttach autocommand is the preferred method to do this, so we
should be showing users how to do it.
2024-12-02 12:13:09 -06:00
dundargoc
c1378413c1 vim-patch:768728b: runtime(doc): Update documentation for "noselect" in 'completeopt'
In particular, make the distinction and interaction between "noinsert"
and "noselect" clearer as it was very confusing before.

closes: vim/vim#16148

768728b487

Co-authored-by: dundargoc <gocdundar@gmail.com>
2024-12-02 08:23:10 +01:00
Christian Clason
36b714e9b7 vim-patch:9a39483: runtime(typst): provide a formatlistpat in ftplugin
closes: vim/vim#16134

9a39483adb

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-12-02 08:19:50 +01:00
zeertzjq
fb689d7ebd
vim-patch:9.1.0899: default for 'backspace' can be set in C code (#31416)
Problem:  default for 'backspace' can be set in C code
Solution: promote the default for 'backspace' from defaults.vim to the C
          code (Luca Saccarola)

closes: vim/vim#16143

959ef61430

N/A patches:
vim-patch:9.1.0895: default history value is too small
vim-patch:075aeea: runtime(doc): document changed default value for 'history'

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-12-02 00:06:57 +00:00
C.D. MacEachern
feb62d5429
docs: example keybind for :Inspect #31391 2024-12-01 13:58:28 -08:00
Christian Clason
9d174a7dac vim-patch:9.1.0898: runtime(compiler): pytest compiler not included
Problem:  runtime(compiler): pytest compiler not included
Solution: include pytest compiler, update the compiler completion test
          (Konfekt)

closes: vim/vim#16130

3c2596a9e9

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-30 13:40:08 +01:00
Christian Clason
4426a326e2 vim-patch:9.1.0897: filetype: pyrex files are not detected
Problem:  filetype: pyrex files are not detected
Solution: detect '*.pxi' and '*.pyx+' as pyrex filetype
          (user202729)

References:
https://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#cython-file-types
https://www.csse.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/using_with_c++.html

closes: vim/vim#16136

aa16b30552

Co-authored-by: user202729 <25191436+user202729@users.noreply.github.com>
2024-11-30 11:41:23 +01:00
Christian Clason
fd865fbd92 vim-patch:dd21c89: runtime(compiler): update eslint compiler
compact formatter is no longer distributed with eslint, so:

- switch to '--format stylish' in makeprg
- update 'errorformat' for the 'stylish' format output

fixes: vim/vim#16126
closes: vim/vim#16137

dd21c89626

Co-authored-by: Romain Lafourcade <romainlafourcade@gmail.com>
2024-11-30 11:39:36 +01:00
Yochem van Rosmalen
2833925cfc
docs(diagnostics): location list / quickfix example #31371 2024-11-29 10:07:08 -08:00
Yi Ming
a1e313ded6
feat(lsp): support textDocument/foldingRange (#31311)
* refactor(shared): extract `vim._list_insert` and `vim._list_remove`

* feat(lsp): add `vim.lsp.foldexpr()`

* docs(lsp): add a todo for state management

* feat(lsp): add `vim.lsp.folding_range.foldclose()`

* feat(lsp): schedule `foldclose()` if the buffer is not up-to-date

* feat(lsp): add `vim.lsp.foldtext()`

* feat(lsp): support multiple folding range providers

* refactor(lsp): expose all folding related functions under `vim.lsp.*`

* perf(lsp): add `lsp.MultiHandler` for do `foldupdate()` only once
2024-11-29 12:40:32 +00:00
Christian Clason
e74316bf48 vim-patch:511eb84: runtime(po): remove poDiffOld/New, add po-format flags to syntax file
fixes: vim/vim#16120
closes: vim/vim#16132

511eb84c08

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-11-29 08:10:51 +01:00
zeertzjq
8d7d225caa vim-patch:65311c6: runtime(compiler): include spotbugs Java linter
closes: vim/vim#16001

65311c6f47

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-11-29 08:57:00 +08:00
Yi Ming
146b8300a1
docs(lsp): update example, optional parameters #31299 2024-11-28 08:08:27 -08:00
Riley Bruins
864f25d6b0 docs: more accurate typing for LSP references context
**Problem:** The `context` parameter for `references()` is just typed as
a table, which is unhelpful.

**Solution:** Properly type it as an `lsp.ReferenceContext`!
2024-11-28 09:05:17 +01:00
zeertzjq
5897994cb7
vim-patch:9.1.0890: %! item not allowed for 'rulerformat' (#31369)
Problem:  %! item not allowed for 'rulerformat'
          (yatinlala)
Solution: also allow to use %! for rulerformat option
          (Yegappan Lakshmanan)

fixes: vim/vim#16091
closes: vim/vim#16118

ac023e8baa

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-11-28 09:02:10 +08:00
dundargoc
76dcc7029b docs: add tag vim.fs.exists() and document suggested replacement 2024-11-27 19:56:08 +01:00
glepnir
203e7a43d1
fix(lsp): mention function name in warning #31301
Problem: The warning message is the same in different functions.
It is not convenient to locate the specific function name

Solution: add function name in warning message
2024-11-27 05:44:29 -08:00
Christian Clason
078e8e57d3 vim-patch:7e501f4: runtime(gzip): load undofile if there exists one
fixes: vim/vim#16102
closes: vim/vim#16122

7e501f4d99

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-27 08:45:22 +01:00
Gregory Anders
d460928263
feat(tui): update 'background' on theme change events (#31350)
Enabling private DEC mode 2031 tells the terminal to notify Nvim
whenever the OS theme changes (i.e. light mode to dark mode or vice
versa) or the terminal emulator's palette changes. When we receive one
of these notifications we query the terminal color's background color
again to see if it has changed and update the value of 'background' if
it has.

We only do this though if the user has not explicitly set the value of
'bg' themselves. The help text is updated slightly to hint to users that
they probably shouldn't set this value: on modern terminal emulators
Nvim is able to completely determine this automatically.
2024-11-26 14:22:01 -06:00
Gregory Anders
99b5ffd688
perf(vim.text): use lookup table implementation for hex encoding (#30080)
Co-authored-by: glepnir <glephunter@gmail.com>
2024-11-26 13:56:01 -06:00
Justin M. Keyes
3d707e6f14
fix(lua): remove vim.loader.disable() #31344
Problem:
`vim.loader.disable` does not conform to `:help dev-name-common` and
`:help dev-patterns`.

Solution:
- Add `enable` parameter to `vim.loader.enable`
- Remove `vim.loader.disable`
- Note the change in `:help news-breaking-dev` (HEAD changes).
  - This is not a breaking change (except to "HEAD") because
    `vim.loader` is marked "experimental".

previous: 26765e8461
2024-11-26 06:15:50 -08:00
zeertzjq
66bb1e577c
vim-patch:9.1.0888: leftcol property not available in getwininfo() (#31349)
Problem:  leftcol property not available in getwininfo()
Solution: add leftcol property property (glepnir)

closes: vim/vim#16119

0a850673e3

Co-authored-by: glepnir <glephunter@gmail.com>
2024-11-26 07:53:07 +08:00
Marcus Caisey
c644228e1d
fix(defaults): omit empty line from unimpaired mapping messages (#31347)
Problem:
The default unimpaired mappings display an empty line after the
command's output. This results (with default configuration) in the
`Press ENTER or type command to continue` prompt to be displayed, like
so:
```
(2 of 16): item2

Press ENTER or type command to continue
```

Solution:
The cause is that we're checking the second return value from
`pcall(vim.api.nvim_cmd, opts, {})` to determine whether the call was
successful. `nvim_cmd` returns an empty string on success, so this value
is an empty string in the successful path which we then display.

The fix is simple: check the first return value instead which is the
"status code" of the call.
2024-11-25 16:33:11 -06:00
Gregory Anders
29c72cdf4a
fix(lsp): retrigger diagnostics request on server cancellation (#31345)
Co-authored-by: Jesse <github@jessebakker.com>
2024-11-25 11:48:11 -06:00
Lewis Russell
8d55cc218c feat(keysets): teach Union and LuaRefOf 2024-11-25 17:34:02 +00:00
Mathias Fußenegger
99e7323aa3
feat(diagnostic): inherit parent 'path' option in open_float (#31273)
Diagnostics sometimes contain stack traces, it's useful being able to
use `CTRL-W F` on them to open related files from within the diagnostic
window.
2024-11-25 17:11:22 +01:00
Yi Ming
165b099fa3
refactor(lsp): rename offset_encoding to position_encoding #31286
Problem:
LSP spec uses the term "position encoding" where we say "offset encoding".

Solution:
- Rename it everywhere except `vim.lsp.Client.offset_encoding` (which would be breaking).
- Mention "position encoding" in the documentation for `vim.lsp.Client.offset_encoding`.
2024-11-25 08:06:05 -08:00
Christian Clason
ff00d583af vim-patch:9.1.0886: filetype: debian control file not detected
Problem:  filetype: debian control file not detected
Solution: detect 'debian/control' files as debcontrol filetype
          (author)

closes: vim/vim#16067

57b947e3c3

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-25 00:05:12 +01:00
zeertzjq
21371c9259
vim-patch:d7745ac: runtime(netrw): Fixing powershell execution issues on Windows (#31333)
closes: vim/vim#16094

d7745acbd8

Co-authored-by: GuyBrush <miguel.barro@live.com>
2024-11-24 14:46:21 +00:00
zeertzjq
5c60306442
vim-patch:9.1.0883: message history cleanup is missing some tests (#31331)
Problem:  message history cleanup is missing some tests
Solution: Add tests, refactor common code into did_set_msghistory()
          (Shougo Matsushita)

closes: vim/vim#16078

9f860a14c3

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Milly <milly.ca@gmail.com>
2024-11-24 14:36:33 +00:00
Christian Clason
ef4f13d85c vim-patch:c1e6621: runtime(c3): include c3 filetype plugin
closes: vim/vim#16090

c1e6621a59

Co-authored-by: Turiiya <34311583+ttytm@users.noreply.github.com>
2024-11-24 15:24:08 +01:00
Christian Clason
9738b405fd vim-patch:ccc024f: runtime(apache): Update syntax directives for apache server 2.4.62
closes: vim/vim#16109

ccc024f3a7

Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
2024-11-24 15:24:08 +01:00
glepnir
2a1f604c77 fix(lsp): delete bufvar inside WinClosed event
Problem: floaing preview window can be closed by some
ex commands like `only` `fclose` which will not clean the bufvar

Solution: use WinClosed event with floating_winnr for clean
bufnr, and add test cases for vim.lsp.util.open_floating_preview
2024-11-24 10:47:05 +00:00
zeertzjq
d9b08c58c3
vim-patch:partial:a01148d: runtime(doc): Expand docs on :! vs. :term (#31321)
fixes: vim/vim#16071
closes: vim/vim#16089

a01148d2cb

Co-authored-by: matveyt <matthewtarasov@yandex.ru>
2024-11-24 06:54:39 +08:00
Christian Clason
46d124a933 vim-patch:cacfccf: runtime(netrw): update netrw's decompress logic
Detect a few more default archive types, correctly handle file
extensions with digits in it.

fixes: vim/vim#16099
closes: vim/vim#16104

cacfccf803

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-23 14:08:16 +01:00
Christian Clason
91295db97d vim-patch:4dd6c22: runtime(apache): Update syntax keyword definition
closes: vim/vim#16105

4dd6c22ebe

Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
2024-11-23 14:08:16 +01:00
andrew snelling
9a681ad09e
fix(lsp): hover keymap (#31208)
* fix: use function call in keymap

* fix: test
2024-11-22 12:51:30 +00:00
glepnir
7d8db54441 fix(lsp): delete b:lsp_floating_preview buf var after win close
Problem: After floating preview window closed the buf var still exist

Solution: delete  after floating window closed.
2024-11-22 10:16:40 +00:00
Christian Clason
6e44a6a289 fix(treesitter): update queries 2024-11-22 09:39:45 +01:00
bfredl
92a83f671b
Merge pull request #31193 from bfredl/winrt
refactor(windows)!: only support UCRT, even for mingw
2024-11-21 18:58:51 +01:00
bfredl
be89d520d7 refactor(windows)!: only support UCRT, even for mingw
The newer UCRT runtime has native support for UTF-8, including forcing
it as the active codepage even before `main()` is called. This means
the c runtime will properly convert windows WCHAR:s into UTF-8 bytes,
as early as the argv/argc params to `main()` . Whereas MSVCRT does not
support this reliably and required us to use `wmain()`.

Only MSVC supports using manifest files directly as source files.
The solution for other Windows toolchains is to use a .rc file.
2024-11-21 12:41:15 +01:00
zeertzjq
01026ba47b
vim-patch:9.1.0862: 'wildmenu' not enabled by default in nocp mode (#31261)
Problem:  'wildmenu' not enabled by default in nocp mode
Solution: promote the default Vim value to true, it has been enabled
          in defaults.vim anyhow, so remove it there (Luca Saccarola)

closes: vim/vim#16055

437bc13ea1

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-11-21 15:37:35 +08:00
dundargoc
07db909eb5
docs: misc (#31138)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-11-21 06:50:30 +08:00
zshuzh
cedf155fb5
refactor(options): impl default 'titlestring' by format flags #30843
Problem:
Unnecessary C impl of default 'titlestring'.

Solutin:
Define it using format flags.
2024-11-20 14:01:59 -08:00
Yi Ming
629483e24e
feat(lsp): require offset_encoding param #31249
Problem:
Since [version 3.17](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocuments),
LSP supports specifying the position encoding (aka offset encoding) supported by
the client through `positionEncoding`. Since #31209, Nvim fully supports
`utf-8`, `utf-16`, and `utf-32` encodings.

Previously, nvim assumed all clients for a buffer had the same
`offset_encoding`, so:
* Nvim provides `vim.lsp._get_offset_encoding()` to get `offset_encoding`, but
  this function is incorrect because `offset_encoding` is per-client, not
  per-buffer.
* Based on the strategy of `vim.lsp._get_offset_encoding()`,
  `vim.lsp.util.make_position_params()`, `vim.lsp.util.make_range_params()`, and
  `vim.lsp.util.make_given_range_params()` do not require the caller to pass
  `offset_encoding`, which is invalid.
* https://github.com/neovim/neovim/issues/25272

Solution:
* Mark `vim.lsp._get_offset_encoding()` as `@deprecated`.
* Change the type annotations of `vim.lsp.util.make_position_params()`,
  `vim.lsp.util.make_range_params()`, `vim.lsp.util.make_given_range_params()`
  to require the `offset_encoding` param.
2024-11-20 12:19:07 -08:00
luukvbaal
1b6442034f
fix(messages): more ext_messages kinds #31279
Add kinds for various commands that output a list, the 'wildmode'
list, and for number prompts.
2024-11-20 12:11:20 -08:00
Lewis Russell
454ae672aa feat(lsp): deprecate non-method client functions
Deprecated:
- `client.request()` -> `client:request()`
- `client.request_sync()` -> `client:request_sync()`
- `client.notify()` -> `client:notify()`
- `client.cancel_request()` -> `client:cancel_request()`
- `client.stop()` -> `client:stop()`
- `client.is_stopped()` `client:is_stopped()`
- `client.supports_method()` -> `client:supports_method()`
- `client.on_attach()` -> `client:on_attach()`

Fixed docgen to link class fields to the full function doc.
2024-11-20 08:51:45 +00:00
Christian Clason
f55c842ec7 vim-patch:9.1.0880: filetype: C3 files are not recognized
Problem:  filetype: C3 files are not recognized
Solution: detect '*.c3*' files as c3 filetype (Turiiya)

closes: vim/vim#16087

c8dfcfc53b

Co-authored-by: Turiiya <34311583+ttytm@users.noreply.github.com>
2024-11-20 09:31:15 +01:00
Christian Clason
23ead4f2cb vim-patch:9.1.0876: filetype: openCL files are not recognized
Problem:  filetype: openCL files are not recognized
Solution: detect '*.cl' files as opencl or lisp filetype,
          include a opencl syntax and filetype plugin (Wu, Zhenyu)

closes: vim/vim#15825

e2c27ca8ef

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-20 09:31:15 +01:00
Christian Clason
4c85c217d3 vim-patch:9.1.0875: filetype: hyprlang detection can be improved
Problem:  filetype: hyprlang detection can be improved
Solution: detect '/hypr/*.conf' files as hyprlang filetype,
          include basic syntax highlighting (Luca Saccarola)

fixes: vim/vim#15875
closes: vim/vim#16064

a13bd294ab

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-11-20 09:31:15 +01:00
Christian Clason
de9ed1ca54 vim-patch:9.1.0874: filetype: karel files are not detected
Problem:  filetype: karel files are not detected
Solution: detect '*.kl' files as karel filetype,
          include syntax and filetype plugin
          (Kirill Morozov)

closes: vim/vim#16075

fdac54d7bb

Co-authored-by: Kirill Morozov <kirill@robotix.pro>
Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
2024-11-20 09:31:15 +01:00
Christian Clason
fd57f39766 vim-patch:4927dae: runtime(compiler): fix escaping of arguments passed to :CompilerSet
See newly added help entry referring to option-backslash

closes: vim/vim#16084

4927daef60

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-20 09:27:36 +01:00
Tomasz N
f111c32ff9
fix(messages): no message kind for search pattern #31272 2024-11-19 16:06:36 -08:00
Lewis Russell
081beb3659 fix(lsp): restore get_language_id behaviour
Ensure filetype is always passed.

Fixes #31262
2024-11-19 12:19:05 +00:00
Christian Clason
c12be1249f vim-patch:9.1.0873: filetype: Vivado files are not recognized
Problem:  filetype: Vivado files are not recognized
Solution: detect '*.mss' files as 'mss' filetype
          (Wu, Zhenyu)

references:
https://docs.amd.com/r/2020.2-English/ug1400-vitis-embedded/Microprocessor-Software-Specification-MSS

closes: vim/vim#15907

a87462a498

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-19 10:44:30 +01:00
Lewis Russell
989a37a594 refactor(lsp): fold in dynamic_registration code into the client
Problem:

Capability register logic is spread across 3 files.

Solution:

- Consolidate (and simplify) logic into the client.
- Teach client.supports_method about resolve methods
2024-11-18 17:09:53 +00:00
luukvbaal
40347f6e27
fix(api): only flush nvim__redraw when necessary #31250
Problem:  Not possible to only set a "redraw later" type with
          nvim__redraw, which seems to be desired for the
          treesitter highlighter.
Solution: Do not update the screen when "flush" is explicitly set to
          false and only redraw later types are present. In that case,
          do not call ui_flush() either.
2024-11-18 06:35:21 -08:00
Yochem van Rosmalen
965dc81f81
fix(checkhealth): disable 'listchars' #31245
Problem:
'listchars' (in particular multispace) breaks visual heading due to
`Whitespace` highlight group.

Solution:
Disable 'list' (and thus all listchars) by default for `checkhealth`
files.

Fixes #31145
2024-11-17 15:33:34 -08:00
Peter Aronoff
cc6992f1ca
feat(defaults): dot-repeat [<Space> #31186
Problem: `[<Space>` and `]<Space>` do not support repetition.

Solution: use `operatorfunc` and `g@l` to make these mappings dot
repeatable.
2024-11-17 13:31:24 -08:00
Riley Bruins
44229bb85b
feat(lsp): highlight hover target/range #31110
**Problem:** Despite the LSP providing the option for language servers
to specify a range with a hover response (for highlighting), Neovim does
not give the option to highlight this range.

**Solution:** Add an option to `buf.hover()` which causes this range to
be highlighted.

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2024-11-17 12:31:32 -08:00
luukvbaal
235cb5bc5f
fix(api): update "range" windows in nvim__redraw #31042
Problem:  nvim__redraw's "range" marks a buffer range for redraw, and subsequently
          flushes the UI without updating the windows containing that buffer.
Solution: Implicitly update the screen, unless specified otherwise.
          Only update the screen with the last call of the treesitter
          on_changedtree() callback.
2024-11-17 11:43:36 -08:00
luukvbaal
e025f5a5b3
fix(messages): proper multiline Lua print() messages #31205
Problem:  Separate message emitted for each newline present in Lua
          print() arguments.
Solution: Make msg_multiline() handle NUL bytes. Refactor print() to use
          msg_multiline(). Refactor vim.print() to use print().
2024-11-17 10:21:50 -08:00
Maria José Solano
38838fb00a
fix(lsp): type-errors, other nits in vim.lsp.log #31235 2024-11-16 18:32:09 -08:00
luukvbaal
cdc9baeaf8
fix(treesitter): remove redundant on_bytes callback #31041
Problem:  Treesitter highlighter implements an on_bytes callback that
          just re-marks a buffer range for redraw. The edit that
          prompted the callback will already have done that.
Solution: Remove redundant on_bytes callback from the treesitter
          highlighter module.
2024-11-16 16:25:10 -08:00
luukvbaal
9c718bc2bc
fix(api): validation, documentation of hl_group #31195
Problem:  Documentation for "hl_group" in nvim_buf_set_extmark() is
          unclear. "hl_group" in nvim_echo() does not accept
          highlight group id.
Solution: Move documentation for highlight group name/id to first
          mention of hl_group. Update nvim_echo() to accept highlight
          group id.
2024-11-16 15:36:11 -08:00