| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#25801)
The prefix option of the diagnostic virtual text can be a function,
but previously it was only a function of diagnostic.
This function should also have additional parameters index and total,
more consistently and similarily as in the prefix function for
`vim.diagnostic.open_float()`.
These additional parameters will be useful when there are too many
number of diagnostics in a single line.
|
|
|
|
|
|
|
|
|
|
| |
Problem:
When enabling diagnostics, there can be diagnostics for unloaded buffer,
but some handlers nevertheless attempt to set extmarks in such buffers.
Solution:
* Exit underline/virtual_text handler if buffer is not loaded.
* Don't require is_loaded as precondition for show(), because handlers
don't necessarily depend on it.
|
| |
|
| |
|
|
|
| |
Allow users to filter diagnostics by specifying severities
|
|
|
|
|
|
| |
Allow users to pass virtual text options to nvim_buf_set_extmark through
the "virtual_text" table in vim.diagnostic.config().
Fixes: https://github.com/neovim/neovim/issues/16545
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: luals returns stricter diagnostics with bundled luarc.json
Solution: Improve some function and type annotations:
* use recognized uv.* types
* disable diagnostic for global `vim` in shared.lua
* docs: don't start comment lines with taglink (otherwise LuaLS will interpret it as a type)
* add type alias for lpeg pattern
* fix return annotation for `vim.secure.trust`
* rename local Range object in vim.version (shadows `Range` in vim.treesitter)
* fix some "missing fields" warnings
* add missing required fields for test functions in eval.lua
* rename lsp meta files for consistency
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* docs(lua): teach lua2dox how to table
* docs(lua): teach gen_vimdoc.py about local functions
No more need to mark local functions with @private
* docs(lua): mention @nodoc and @meta in dev-lua-doc
* fixup!
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
---------
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|
| |
|
|
|
|
| |
- vim.diagnostic.config() now accepts a function for the virtual_text.prefix
option, which allows for rendering e.g., diagnostic severities differently.
|
|
|
|
| |
See `:h diagnostic-structure`, the property name is `bufnr`, not
`buffer`.
|
|
|
|
|
|
| |
The LSP spec supports two tags that can be added to diagnostics:
unnecessary and deprecated. Extend vim.diagnostic to be able to handle
these.
|
| |
|
| |
|
|
|
|
| |
This reverts a change introduced in
4ace9e7e417fe26c8b73ff1d6042e6e4f3df9ebf.
|
|
|
| |
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|
| |
|
|
|
| |
Sort diagnostics by column number in quickfix list
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The BufWipeout autocmd is not 100% reliable and may leave stale entries
in the cache. This is sort of a hack/workaround to ensure
`vim.diagnostic.reset` calls don't fail if there are stale cache entries
but instead clears them
Fixes errors like
Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/diagnostic.lua:1458: Invalid buffer id: 22
stack traceback:
[C]: in function 'nvim_exec_autocmds'
/usr/share/nvim/runtime/lua/vim/diagnostic.lua:1458: in function 'reset'
|
| |
|
|
|
|
|
| |
Some functions didn't include the `nil` case in the return type
annotation. This corrects those and also adds a Diagnostic class
definition for the diagnostic.get return type
|
|
|
|
|
|
|
| |
This introduces a `suffix` option to the `virt_text` config in
`vim.diagnostic.config()`. The suffix can either be a string which is appended
to the diagnostic message or a function returning such. The function receives a
`diagnostic` argument, which is the diagnostic table of the last diagnostic (the
one whose message is rendered as virt text).
|
|
|
|
|
|
|
|
|
|
|
| |
Closes #18687
This introduces a `suffix` option to `vim.diagnostic.open_float()` (and
consequently `vim.diagnostic.config()`) that appends some text to each
diagnostic in the float.
It accepts the same types as `prefix`. For multiline diagnostics, the suffix is
only appended to the last line. By default, the suffix will render the
diagnostic error code, if any.
|
|
|
|
|
| |
* fix(diagnostic): use api variable and improve validate
* fix: fix test case
|
|
|
|
| |
Added `nil` as a possible option to `vim.diagnostics.goto_prev` in the
docs
|
| |
|
|
|
|
|
| |
(#20207)
Follow up to #20173.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Doing so on `BufDelete` has issues:
- `BufDelete` is also fired for listed buffers that are made unlisted.
- `BufDelete` is not fired for unlisted buffers that are deleted.
This means that diagnostics will be lost for a buffer that becomes unlisted.
It also means that if an entry exists for an unlisted buffer, deleting that
buffer later will not remove its entry from the cache (and you may see "Invalid
buffer id" errors when using diagnostic functions if it was wiped).
Instead, remove a buffer from the cache if it is wiped out.
This means simply `:bd`ing a buffer will not clear its diagnostics now.
|
|
|
| |
Co-authored-by: Gregory Anders <greg@gpanders.com>
|
|
|
|
| |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Valery Viktorovsky <viktorovsky@gmail.com>
|
| |
|
|
|
| |
Signed-off-by: Raphael <glephunter@gmail.com>
|
|
|
|
| |
* reformat Lua runtime to make lint CI pass
* reduce max line length to 100
|
| |
|
| |
|
|
|
|
|
| |
Use nvim_exec_autocmds to issue the DiagnosticChanged autocommand,
rather than nvim_buf_call, which has some side effects when drawing
statuslines.
|
|
|
|
| |
* make `open_float` respect `scope` option set in `vim.diagnostic.config`
* Closes #17878
|
|
|
|
|
|
|
|
|
| |
also update documentation
BREAKING CHANGE: signature of highlight.range is now
vim.highlight.range(bufnr, ns, hlgroup, start, finish,
{ regtype = regtype, inclusive = inclusive, priority = priority })
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
|
|
|
|
| |
This matches the LSP handlers, and forces the qflist for diagnostics to
span across the horizontal space, below all open windows.
|
|
|
|
|
|
|
|
|
| |
Closes https://github.com/neovim/neovim/issues/17456
* treesitter uses the default highlight priority of 50
* diagnostic highlights have a priority of 150
* lsp reference highlights have a priority of 200
This ensures proper ordering.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
In functions which allow opts to be optional, ensure that the value
actually resolves to a non-nil value.
|
|
|
|
|
|
| |
As revealed by #16745, some functions pass a nil value to API functions,
which have been implicitly converted to 0. #16745 breaks this implicit
conversion, so explicitly pass a resolved buffer number to these API
functions.
|
|
|
|
|
|
| |
Function arguments that expect a list should explicitly use tbl_islist
rather than just checking for a table. This helps catch some simple
errors where a single table item is passed as an argument, which passes
validation (since it's a table), but causes other errors later on.
|
|
|
|
|
|
|
|
|
| |
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Christoph Hasse <hassec@users.noreply.github.com>
Co-authored-by: Alef Pereira <ealefpereira@gmail.com>
Co-authored-by: AusCyber <willp@outlook.com.au>
Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
The `prefix_source` function only evaluates the sources from the
diagnostics passed to it; however, because each namespace draws its own
virtual text, its diagnostics will never contain more than a single
source (by definition). This requires changing the semantics of what
"if_many" means from "multiple sources in a single 'batch' of
diagnostics" to "multiple sources of all diagnostics within a buffer".
|
|
|
| |
No longer required since #16548.
|