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
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
Maria José Solano
38838fb00a
fix(lsp): type-errors, other nits in vim.lsp.log #31235
2024-11-16 18:32:09 -08:00
Lewis Russell
d3e4ffafff
feat(lsp): support utf-8 and utf-32 position encodings
...
Resolves #30034
2024-11-14 15:32:49 +00:00
Kristijan Husak
33d10db5b7
fix(lsp): filter completion candidates based on completeopt ( #30945 )
2024-11-13 15:18:29 +00:00
Nicolas Hillegeer
9aab98a275
refactor(lsp): avoid redundant function wrapping
...
Leftover from #21026 .
2024-11-12 16:10:16 +00:00
Lewis Russell
3e855d533f
perf(lsp): use faster version of str_byteindex
2024-11-11 14:23:38 +00:00
Riley Bruins
c5f217db01
refactor(lsp): simplify reference range logic
2024-11-10 09:40:37 +00:00
Lewis Russell
4b001f297a
fix(lsp): fix infinite loop
...
Fixes #31129
2024-11-09 09:41:12 +00:00
Lewis Russell
7342e6b00d
perf(lsp): do not apply semantic tokens to folded lines
...
Fixes #31106
2024-11-08 14:01:35 +00:00
Lewis Russell
6e68fed374
feat(lsp): multi-client support for signature_help
...
Signatures can be cycled using `<C-s>` when the user enters the floating
window.
2024-11-04 11:55:39 +00:00
Lewis Russell
9b357e30fd
feat(lsp)!: remove client-server handlers from vim.lsp.handlers
...
- Partition the handlers in vim.lsp.handlers as:
- client to server response handlers (RCS)
- server to client request handlers (RSC)
- server to client notification handlers (NSC)
Note use string indexes instead of protocol.methods for improved
typing in LuaLS (tip: use hover on RCS, RSC or NSC).
2024-11-01 09:17:39 +00:00
nikolightsaber
f54266dbed
fix(lsp): hover border type can be string ( #31013 )
...
Border type can also be a string as defined in `api-win_config`
Co-authored-by: Nikolai Devolder <nikolai.devolder@yamabiko.eu >
2024-11-01 10:03:09 +01:00
notomo
b4599acbf8
fix(lsp): correct hover result handling ( #30995 )
...
Problem: vim.lsp.buf.hover() displays "No information available" when client_id
is not 1.
Solution: use vim.tbl_isempty(tbl) instead of #tbl==0
2024-10-30 16:57:33 +01:00
Lewis Russell
2cd6abf0d7
Merge pull request #30935 from lewis6991/feat/lsp_multi_hover
2024-10-29 09:51:14 +00:00
Lewis Russell
8260e4860b
feat(lsp)!: multiple client support for vim.lsp.buf.hover()
...
Deprecate `vim.lsp.handlers.hover` and `vim.lsp.handlers['textDocument/hover']`
2024-10-29 09:06:05 +00:00
Maria José Solano
0086ee90dd
fix(lsp): list all workspace folders in healthcheck #30966
2024-10-28 06:14:56 -07:00
Maria José Solano
123c0b6b4e
docs(lsp): document alternative for vim.lsp.util.jump_to_location
2024-10-27 09:26:52 +00:00
Tristan Knight
25b53b593e
refactor(lsp): drop str_byteindex/str_utfindex wrappers #30915
...
* deprecate old signatures
* move to new str_byteindex/str_utfindex signature
* use single-underscore name (double-underscore is reserved for Lua itself)
2024-10-26 07:38:25 -07:00
Lewis Russell
54249d051c
feat(lsp): deprecate vim.lsp.buf.completion
...
Use `vim.lsp.completion.trigger()` instead'
2024-10-24 16:36:14 +01:00
Lewis Russell
7a7747f1e4
feat(lsp): deprecate execute_command with client:exec_cmd
2024-10-24 15:37:34 +01:00
Lewis Russell
39d79efa1e
fix(lsp): better multi-client support for callHierarchy
...
Only ever display a dialogue box once.
Switch from vim.fn.inpulist to vim.ui.select
refactor(lsp): merge call and type hierarchy functions
2024-10-24 13:15:25 +01:00
Lewis Russell
c8d7d65679
fix(lsp): use correct method for prepareTypehierarchy
...
Regression from #30902
2024-10-24 13:15:25 +01:00
Mathias Fussenegger
3c51058d76
fix(lsp): set tagstack on jump via goto methods
...
Follow up to https://github.com/neovim/neovim/pull/30877
Fixes https://github.com/neovim/neovim/issues/30926
2024-10-24 13:43:49 +02:00
Lewis Russell
2dcbfe78fc
fix(lsp.buf): use correct offset_encoding for all requests
...
Problem:
`lsp.buf_request` send the same params to all servers and many
calls to this pass PositionalParams which depends on the clients
offset_encoding. This can result with incorrect params being sent
to a server.
Solution:
`lsp.buf_request` `params` argument can now be passed as a function
which takes the client as the first argument. This is used in
lsp/buf.lua to construct correct params for each client request.
2024-10-24 10:53:06 +01:00
Lewis Russell
3275ae830d
fix(lsp.protocal): improve typing of constants
2024-10-24 10:53:03 +01:00
Lewis Russell
2ee39b7eb4
refactor(lsp.buf): remove buf_request wrapper
2024-10-24 09:58:22 +01:00
Lewis Russell
ad4e14c201
refactor(lsp.buf): use alias for vim.lsp
2024-10-24 09:55:23 +01:00
Mathias Fussenegger
008782208d
fix(lsp): handle mixed encoding in tagfunc params
...
Relates to https://github.com/neovim/neovim/issues/30034
2024-10-24 09:56:58 +02:00
Lewis Russell
629a5b71b5
fix(lsp): support multiple clients in typehierarchy
2024-10-22 21:59:48 +01:00
Lewis Russell
3572319b4c
feat(vim.validate): improve fast form and deprecate spec form
...
Problem:
`vim.validate()` takes two forms when it only needs one.
Solution:
- Teach the fast form all the features of the spec form.
- Deprecate the spec form.
- General optimizations for both forms.
- Add a `message` argument which can be used alongside or in place
of the `optional` argument.
2024-10-21 11:32:06 +01:00
Justin M. Keyes
18b43c331d
refactor: rename vim.highlight => vim.hl
...
Problem:
- `vim.highlight` module does not follow `:help dev-name-common`, which
documents the name for "highlight" as "hl".
- Shorter names are usually preferred.
Solution:
Rename `vim.highlight` to `vim.hl`.
This is not a breaking change until 2.0 (or maybe never).
2024-10-21 00:54:43 +02:00
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
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
temhelk
564173e556
fix(lsp.util): wrong arguments to 'validate' function
2024-10-18 07:37:36 +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