| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Problem: health can not shown in a floating window
Solution: add g:health variable
|
|
|
|
|
| |
Problem: open_floating_preview() may be hidden behind current window if
that is floating and has a higher zindex.
Solution: Open floating preview with zindex higher than current window.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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`.
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Problem: After floating preview window closed the buf var still exist
Solution: delete after floating window closed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Signatures can be cycled using `<C-s>` when the user enters the floating
window.
|
|
|
|
|
| |
Border type can also be a string as defined in `api-win_config`
Co-authored-by: Nikolai Devolder <nikolai.devolder@yamabiko.eu>
|
| |
|
|
|
|
|
| |
* deprecate old signatures
* move to new str_byteindex/str_utfindex signature
* use single-underscore name (double-underscore is reserved for Lua itself)
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|\ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
- Remove the trivial function vim.lsp.util._get_symbol_kind_name()
and its tests.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
tagfunc failed in a weird buffer (either a directory or some other
non-file buffer, I don't remember):
E987: Invalid return value from tagfunc
E5108: Error executing lua …/runtime/lua/vim/lsp/util.lua:311: EISDIR: illegal operation on a directory
stack traceback:
at this line:
local data = assert(uv.fs_read(fd, stat.size, 0))
Solution:
Check for directory.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
- Some servers like LuaLS add unwanted blank lines after multiline
`@param` description.
- List items do not wrap nicely.
Solution:
- When rendering the LSP doc hover, remove blank lines in each `@param`
or `@return`.
- But ensure exactly one empty line before each.
- Set 'breakindent'.
|
|
|
|
| |
Analogous to the shell `rm` command.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
The LSP omnifunc can insert nil bytes, which when read in other places
(like semantic token) could cause an error:
semantic_tokens.lua:304: Vim:E976: Using a Blob as a String
Solution:
Use `#line` instead of `vim.fn.strlen(line)`. Both return UTF-8 bytes
but the latter can't handle nil bytes.
Completion candidates can currently insert nil bytes, if other parts of
Alternative fix to https://github.com/neovim/neovim/pull/30359
Note that https://github.com/neovim/neovim/pull/30315 will avoid the
insertion of nil bytes from the LSP omnifunc, but the change of this PR
can more easily be backported.
|
|
|
|
|
|
|
|
|
|
| |
Problem:
str_utfindex_enc could return an error if the index was longer than the
line length. This was handled in each of the calls to it individually
Solution:
* Fix the call at the source level so that if the index is higher than
the line length, utf length is returned
|