| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
Errors were being caused by invalid buffers being kept around in
diagnostic_cache, so add a metatable to diagnostic_cache which attaches
to new buffers in the cache, removing them after they are invalidated.
Closes #16391.
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The current 'clamp_line_numbers' implementation modifies diagnostics in
place, which can have adverse downstream side effects. Before clamping
line numbers, make a copy of the diagnostic. This commit also merges the
'clamp_line_numbers' method into a new 'get_diagnostics' local function
which also implements the more general "get" method. The public
'vim.diagnostic.get()' API now just uses this function (without
clamping). This has the added benefit that other internal API functions
that need to use get() no longer have to go through vim.validate.
Finally, reorganize the source code a bit by grouping all of the data
structures together near the top of the file.
|
| | |
|
|/
|
|
|
| |
* send vim.NIL instead of not sending workspaceFolders
* read fallback rootPath and rootUri from workspaceFolders
* update documentation
|
|
|
|
|
| |
closes https://github.com/neovim/neovim/issues/16352
* improve handling of multi-byte deletions
|
|
|
|
|
|
| |
See:
- https://emmylua.github.io/annotations/param.html
- https://emmylua.github.io/annotations/return.html
|
|
|
|
|
| |
If the quickfixlist item doesn't contain a column it is reported as 0.
Rather than using a nil value in such a case (which breaks diagnostics
elsewhere), just keep the 0 value.
|
| |
|
| |
|
|
|
|
|
| |
the prior signature did not assume an active language client
this function can now be used directly by passing an offset encoding
defaults to utf-16 (standard for LSP)
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Rename the `show_header` option in `open_float` to simply `header` and
allow users to specify both the header string as well as the highlight
group.
|
| |
| |
| |
| |
| | |
Extend the 'prefix' option for `open_float` to also provide an optional
highlight group for the prefix string.
|
| |
| |
| |
| |
| |
| |
| | |
Make the bufnr argument have similar semantics across API functions;
namely, a nil value means "all buffers" while 0 means "current buffer".
This increases the flexibility of the API by allowing functions such as
enable() and disable() to apply globally or per-namespace, rather than
only on a specific buffer.
|
|/ |
|
|
|
|
| |
The 'prefix' option accepts a function or a string that is used to add a
prefix string to each diagnostic displayed in the floating window.
|
|
|
|
|
|
|
|
|
| |
If a LSP server sent a workspace edit containing a rename the buffers
file name changed without the server receiving a close notification for
the old buffer and without the client properly re-attaching on the new
file.
This affected `Move` code-actions in nvim-jdtls, but also
`vim.lsp.buf.rename` on a class level.
|
|
|
| |
* handle when workspaceFolder is nil in buf.list_workspace_folders and buf.add_workspace_folder
|
|
|
|
|
|
| |
* use codeunits/points instead of byte ranges when applicable
* take into account different file formats when computing range and
sending text (dos, unix, and mac supported)
* add tests of incremental sync
|
|
|
|
|
|
|
| |
Also fix a few other small bugs regarding saving and restoring extmarks.
In particular, now that the virtual text and underline handlers have
their own dedicated namespaces, they should be responsible for saving
and restoring their own extmarks. Also fix the wrong argument ordering
in the call to `clear_diagnostic_cache` in the `on_detach` callback.
|
| |
|
|
|
|
|
|
| |
* vim.ui.input is an overridable function that prompts for user input
* take an opts table and the `on_confirm` callback, see `:help vim.ui.input` for more details
* defaults to a wrapper around vim.fn.input(opts)
* switches the built-in client's rename handler to use vim.ui.input by default
|
|
|
|
| |
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
Sometimes plugins use pseudo-client IDs (e.g. nvim-lint or null-ls) in
order to hook into the LSP infrastructure without being a bona fide LSP
client. In these cases, get_client_by_id() will return nil since the
client ID given does not correspond to a real client recognized by the
LSP subsystem. When this happens, use "unknown" for the client name.
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|
|
|
|
|
| |
* use table.insert instead of list_extend to avoid validation overhead
Co-authored-by: Gianmarco Fantinuoli <fanto-dev@hotmail.com>
|
| |
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: Meck <yesmeck@gmail.com>
Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Fixes a bug introduced by https://github.com/neovim/neovim/pull/15949
When no supported clients for a given method are available, buf_request
returns early with a nil value. If buf_request_sync is called on a
buffer with no clients that support a given method, the returned
`cancel` method (which is nil), is invoked, resulting in an error.
Solution: return an empty function handle
|
|
|
|
|
|
| |
* Opens quickfix list spanning the entire nvim window in location
handlers
closes https://github.com/neovim/neovim/issues/12241
|
|
|
|
|
|
|
| |
Rather than treating virtual_text, signs, and underline specially,
introduce the concept of generic "handlers", of which those three are
simply the defaults bundled with Nvim. Handlers are called in
`vim.diagnostic.show()` and `vim.diagnostic.hide()` and are used to
handle how diagnostics are displayed.
|
| |
|
| |
|
|
|
|
|
|
|
| |
* This flag allows customizing the time before sending kill -15 to the
server. If set to false, neovim exits immediately after sending
request('shutdown'). Otherwise, polls until all servers have shutdown,
and then kills remaining servers via kill -15 at exit_timeout
duration. Defaults to 500 ms.
|
|
|
|
|
|
|
| |
closes https://github.com/neovim/neovim/issues/16058
* add client.attached_buffers
* only update client.attached_buffers in on_attach
* use table instead of list for attached_buffers to avoid duplication
|
|
|
| |
* `where` was renamed to `scope`
|
|
|
|
| |
Setting focus_id allows the float to be focused by calling the function
a second time (a feature of open_floating_preview).
|
| |
|
|
|
|
|
| |
The spacing fix drew attention to a couple of places that were using
incorrect formatting such as the key listing for `nvim_open_win`, so
those were fixed too.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'show_line_diagnostics()' and 'show_position_diagnostics()' are
almost identical; they differ only in the fact that the latter also
accepts a column to form a full position, rather than just a line. This
is not enough to justify two separate interfaces for this common
functionality.
Renaming this to simply 'show_diagnostics()' is one step forward, but
that is also not a good name as the '_diagnostics()' suffix is
redundant. However, we cannot name it simply 'show()' since that
function already exists with entirely different semantics.
Instead, combine these two into a single 'open_float()' function that
handles all of the cases of showing diagnostics in a floating window.
Also add a "float" key to 'vim.diagnostic.config()' to provide global
values of configuration options that can be overridden ephemerally.
This makes the float API consistent with the rest of the diagnostic API.
BREAKING CHANGE
|