Commit Graph
3499 Commits
Author SHA1 Message Date
Mathias Fußenegger 0083e03d6f feat(lsp)!: support multiple clients in goto methods (#30877)
Relates to:

- https://github.com/neovim/neovim/issues/30034
- https://github.com/neovim/neovim/issues/17712
- https://github.com/neovim/neovim/issues/16363

Closes:

- https://github.com/neovim/neovim/issues/26936 (but only provides bufnr
  and method)
- https://github.com/neovim/neovim/issues/22318

Might fix: https://github.com/neovim/neovim/issues/30737
2024-10-20 23:40:44 +02:00
zeertzjq 9b8907d905 feat(float): allow enabling mouse for non-focusable window (#30844)
Problem:  Cannot allow mouse interaction for non-focusable float window.
Solution: Add a "mouse" field to float window config.
2024-10-20 22:18:26 +08:00
Mathias Fussenegger dff684fdb3 feat(lsp)!: support multiple clients in lsp.buf.references
Relates to:

- https://github.com/neovim/neovim/issues/17712
- https://github.com/neovim/neovim/issues/30034
2024-10-20 14:43:22 +02:00
zeertzjq 3cf602486c feat(terminal)!: make 'belloff' and 'visualbell' apply to terminal bell (#30859)
vim-patch:8.2.4744: a terminal window can't use the bell
vim-patch:8.2.4745: using wrong flag for using bell in the terminal

BREAKING CHANGE: Bells from :terminal are now silent by default, unless
'belloff' option doesn't contain "term" or "all".
2024-10-20 07:59:43 +08:00
Uthman Mohamed f4b620c4e6 feat(vim.ui.open): support lemonade #30845 2024-10-18 02:22:15 -07:00
temhelk 564173e556 fix(lsp.util): wrong arguments to 'validate' function 2024-10-18 07:37:36 +01:00
Maria José Solano 31745b17e6 fix(types): add narrower vim.validate types 2024-10-18 07:36:54 +01:00
Lewis Russell 3f3e4837d5 perf(validate): use lighter version
- Also fix `vim.validate()` for PUC Lua when showing errors for values
  that aren't string or number.
2024-10-17 16:53:52 +01:00
Lewis Russell fa6ab0d909 Merge pull request #30825 from lewis6991/refactor/lsputil 2024-10-17 13:35:02 +01:00
Lewis Russell a18fa2f11c feat(lsp.util): minor codestyle 2024-10-17 12:52:46 +01:00
Lewis Russell cbc82011ce feat(lsp.util): improve offset_encoding type annotations 2024-10-17 12:52:45 +01:00
Lewis Russell e954a16063 feat(lsp.util): remove some variables 2024-10-17 12:52:45 +01:00
Lewis Russell 97119a2369 feat(lsp.util): use vim.w/b 2024-10-17 12:52:45 +01:00
Lewis Russell 3f87e222f7 feat(lsp.util): remove some aliases 2024-10-17 12:52:45 +01:00
Lewis Russell 8ad000ef7c feat(lsp.util): remove unneeded table 2024-10-17 12:52:45 +01:00
Lewis Russell acbc6a7f91 fix(lsp.util): inconsistent handling of offset_encoding 2024-10-17 12:52:45 +01:00
Lewis Russell ff1d7d4299 feat(lsp.util): get_bufs_with_prefix -> get_writeable_bufs 2024-10-17 12:52:45 +01:00
Lewis Russell 1944c0d610 feat(lsp.util): refactor get_border_size() 2024-10-17 12:52:45 +01:00
Lewis Russell d44d36b8ff feat(lsp.util): simplify some bounds checking 2024-10-17 12:52:45 +01:00
Lewis Russell 0621718e3b feat(lsp.util): remove metatable in locations_to_items 2024-10-17 12:52:45 +01:00
Lewis Russell f0973d4227 feat(lsp.util): refactor symbols_to_items()
- Remove the trivial function vim.lsp.util._get_symbol_kind_name()
  and its tests.
2024-10-17 12:52:45 +01:00
Lewis Russell 5bec7288a5 feat(lsp.util): remove uneeded do-end 2024-10-17 12:52:45 +01:00
Lewis Russell 1edfe5c09e feat(lsp.util): use vim.api alias 2024-10-17 12:52:45 +01:00
Lewis Russell 92e4e3fb76 feat(lsp.util): fix type errors 2024-10-17 12:52:44 +01:00
Lewis Russell 21151144c6 feat(meta): add type for quickfix entries 2024-10-17 10:54:19 +01:00
Jordan ce678043e3 feat(lsp): show server name in code actions #30830
Problem:
If there are multiple LSP clients, it's not clear which actions are provided by which servers. #30710

Solution:
Show the server name next to each action (only if there are multiple clients).
2024-10-17 01:35:19 -07:00
zeertzjqandMilly c89150241d vim-patch:6c2fc37: runtime(help): Update help syntax
This commit makaes the following changes to the vim help syntax:

- fix excessive URL detection in help, because `file:{filename}` in
  doc/options.txt is determined to be a URL.
- update highlighting N for :resize in help
- split Italian-specific syntax into separate help script
- highlight `Note` in parentheses in help
- update 'titlestring' behaviour in documentation for invalid '%' format

closes: vim/vim#15883

https://github.com/vim/vim/commit/6c2fc377bfbfb6f1a46b1061413cd21116b596ed

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-17 07:55:55 +08:00
Tristan Knight 80e37aa533 fix(lsp): str_byteindex_enc bounds checking #30747
Problem:
Previously the index was only checked against the UTF8 length. This
could cause unexpected behaviours for strings containing multibyte chars

Solution:
Check indicies correctly against their max value before returning the
fallback length
2024-10-16 09:12:19 -07:00
Lewis Russell 0e8568d72c feat(lsp.util): remove lsp spec extract 2024-10-16 12:39:28 +01:00
Lewis Russell 0066dd0f65 feat(lsp.util): use faster version of vim.validate 2024-10-16 12:39:27 +01:00
Christian Clason 82b02ae2f2 fix(runtime): clean up one-off scripts
Problem: Some runtime files no longer spark joy.

Solution: Kondo the place up.

Still sparks _some_ joy (moved to new `runtime/scripts` folder):
* `macros/less.*`
* `mswin.vim`
* `tools/emoji_list.lua`

No longer sparks joy (removed):
* `macmap.vim` (gvimrc file; not useful in Nvim)
* `tools/check_colors.vim` (no longer useful with new default colorscheme and treesitter)
* `macros/editexisting.vim` (throws error on current Nvim)
* `macros/justify.vim` (obsolete shim for `packadd! justify`)
* `macros/matchit.vim` (same)
* `macros/shellmenu.vim` (same)
* `macros/swapmous.vim` (same)
2024-10-15 20:50:21 +02:00
zeertzjqandJeremy Fleischman 84623dbe93 vim-patch:9.1.0785: cannot preserve error position when setting quickfix list (#30820)
Problem:  cannot preserve error position when setting quickfix lists
Solution: Add the 'u' action for setqflist()/setloclist() and try
          to keep the closes target position (Jeremy Fleischman)

fixes: vim/vim#15839
closes: vim/vim#15841

https://github.com/vim/vim/commit/27fbf6e5e8bee5c6b61819a5e82a0b50b265f0b0

Co-authored-by: Jeremy Fleischman <jeremyfleischman@gmail.com>
2024-10-15 18:53:59 +08:00
Maria José Solano e0a5c3bb58 fix(lsp): handle multiline signature help labels #30460 2024-10-15 02:36:04 -07:00
zeertzjqandChristian Brabandt dbd172e7e9 vim-patch:5bcfb5a: runtime(doc): add some docs for file-watcher programs
fixes: vim/vim#15733

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

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-15 08:21:19 +08:00
zeertzjqandsaher 9701cbf036 vim-patch:7b5e52d: runtime(doc): add preview flag to statusline example
Problem:  The standard statusline example is missing the preview flag
          "%w"
Solution: Add the preview flag "%w"

closes: vim/vim#15874

https://github.com/vim/vim/commit/7b5e52d16fb457c90cc44340a6190712aab7e03b

Co-authored-by: saher <msaher.shair@gmail.com>
2024-10-15 08:19:46 +08:00
d04d7bf65d vim-patch:9.1.0779: filetype: neomuttlog files are not recognized
Problem:  filetype: neomuttlog files are not recognized
Solution: detect '*.neomuttdebug' file as neomuttlog filetype,
          include neomuttlog syntax script (Richard Russon)

closes: vim/vim#15858

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

Co-authored-by: Richard Russon <rich@flatcap.org>
Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
2024-10-14 09:31:24 +02:00
Christian ClasonandAndis Spriņķis 15aa27bc1f vim-patch:9.1.0778: filetype: lf config files are not recognized
Problem:  filetype: lf config files are not recognized
Solution: detect lfrc files as lf filetype, include a syntax
          script for lf files (Andis Spriņķis).

References:
- https://github.com/gokcehan/lf

closes: vim/vim#15859

https://github.com/vim/vim/commit/0f146b7925178a5bdfdc8e07642976f0b76d9612

Co-authored-by: Andis Spriņķis <spr.andis@protonmail.com>
2024-10-14 08:27:37 +02:00
glepnir 2d24558c28 docs: update autotrigger description of vim.lsp.compleiton.BufferOpts (#30796)
Currently the behavior of autotrigger is not well documented.
2024-10-13 12:44:05 +02:00
Christian Clasonandnisbet-hubbard 06625f9b3a vim-patch:9.1.0777: filetype: Some upstream php files are not recognized
Problem:  filetype: Some upstream php files are not recognized
Solution: Detect more config files from the PHP source
          distribution as filetype ini (nisbet-hubbard).

closes: vim/vim#15840

https://github.com/vim/vim/commit/367499c5c39057bca267716d9aad20554d4d83fd

Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
2024-10-13 00:46:29 +02:00
zeertzjq 45f8f957c0 docs(lua): clarify when on_key "typed" will be empty (#30774) 2024-10-12 12:20:06 +08:00
zeertzjq 0e42c81c7f fix(lua): avoid recursive vim.on_key() callback (#30753) 2024-10-12 08:07:05 +08:00
Gregory Anders 26e765f905 feat(defaults): map gri to vim.lsp.buf.implementation() (#30764)
Continuing the default LSP maps under the "gr" prefix. Mnemonic: "i" for
"implementation".
2024-10-11 11:56:21 -05:00
Riley Bruins d3193afc25 fix(treesitter): remove duplicate symbol names in language.inspect()
**Problems:**

- `vim.treesitter.language.inspect()` returns duplicate
  symbol names, sometimes up to 6 of one kind in the case of `markdown`
- The list-like `symbols` table can have holes and is thus not even a
  valid msgpack table anyway, mentioned in a test

**Solution:** Return symbols as a map, rather than a list, where field
names are the names of the symbol. The boolean value associated with the
field encodes whether or not the symbol is named.

Note that anonymous nodes are surrounded with double quotes (`"`) to
prevent potential collisions with named counterparts that have the same
identifier.
2024-10-11 18:15:07 +02:00
Riley Bruins 267c7525f7 feat(treesitter): introduce child_with_descendant()
This commit also marks `child_containing_descendant()` as deprecated
(per upstream's documentation), and uses `child_with_descendant()` in
its place. Minimum required tree-sitter version will now be `0.24`.
2024-10-11 17:29:45 +02:00
Justin M. Keyes c3cb702ac7 fix(lsp): set 'smoothscroll' in docs hover #30748 2024-10-11 00:50:09 -07:00
Christian Clasonandnisbet-hubbard 79c036747a vim-patch:9.1.0773: filetype: some Apache files are not recognized
Problem:  filetype: some Apache files are not recognized
Solution: Detect more config files from the Apache source
          distribution as filetype apache (nisbet-hubbard)

closes: vim/vim#15810

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

Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
2024-10-11 08:59:37 +02:00
zeertzjq 6f1601a1b9 vim-patch:9.1.0774: "shellcmdline" doesn't work with getcompletion() (#30750)
Problem:  "shellcmdline" doesn't work with getcompletion().
Solution: Use set_context_for_wildcard_arg() (zeertzjq).

closes: vim/vim#15834

https://github.com/vim/vim/commit/85f36d61e09b12d6f1c60201129823371daa4a84
2024-10-10 22:48:45 +00:00
b3109084c2 fix(lsp): fix cursor position after snippet expansion (#30659)
Problem: on `CompleteDone` cursor can jump to the end of line instead of
the end of the completed word.

Solution: remove only inserted word for snippet expansion instead of everything
until eol.

Fixes #30656

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2024-10-10 11:40:03 +02:00
zeertzjqandglepnir 8450752f46 vim-patch:9.1.0771: completion attribute hl_group is confusing
Problem:  Currently completion attribute hl_group is combined with
          all items, which is redundant and confusing with kind_hlgroup
Solution: Renamed to abbr_hlgroup and combine it only with the abbr item
          (glepnir).

closes: vim/vim#15818

https://github.com/vim/vim/commit/0fe17f8ffbd2588ecd2bf42dced556897bc64f89

Co-authored-by: glepnir <glephunter@gmail.com>
2024-10-10 07:21:02 +08:00
zeertzjq 8ef3dd3afa docs(lua): "vim.bo" is always equivalent to :setlocal (#30733)
vim.bo

    :lua vim.bo.textwidth = 80
    :setglobal textwidth?
      textwidth=0

:setlocal

    :setlocal textwidth=80
    :setglobal textwidth?
      textwidth=0

:set

    :set textwidth=80
    :setglobal textwidth?
      textwidth=80
2024-10-09 11:31:14 +00:00