aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/diagnostic.lua
Commit message (Collapse)AuthorAge
...
* fix(diagnostics): avoid jumping to diagnostics in deleted ranges #35088Sergei Slipchenko2025-07-28
| | | | | | | | | | | | Problem: diagnostic extmark used for positioning continues to exist after deleting a range containing it, so it's possible to jump to a next/previous diagnositc, which isn't visible in any way, including not being shown via `open_float`. Solution: enable `invalidate` flag when setting an extmark to be able to filter out diagnostics based on `invalid` flag when looking for next/previous diagnostic to jump to.
* fix(diagnostics): position diagnostics using extmarks #34014Sergei Slipchenko2025-07-25
| | | | | | | | | | | | | Problem: Diagnostic positions are not being updated after text changes, which means `vim.diagnostic.open_float` and `vim.diagnostic.jump` will work with outdated positions when text is changed until diagnostics are updated again (if ever). Solution: Create extmarks in `vim.diagnostic.set` and use their positions for `vim.diagnostic.open_float` and `next_diagnostic` (used by `vim.diagnostic.jump`, `vim.diagnostic.get_next` and `vim.diagnostic.get_prev`).
* fix(diagnostics): extend conversion support from/to quickfix format (#34006)Mike2025-07-25
| | | | | Use uppercase to check severity Mark quickfix items as valid when converting from diagnostics Support nr/code attribute between formats
* feat(diagnostic): jump to related info location from `open_float` #34837Riley Bruins2025-07-10
| | | | | | This commit allows users to jump to the location specified in a diagnostic's `relatedInformation`, using `gf` from within the `open_float` window. The cursor need only be on line that displays the related info.
* feat(lsp): support diagnostic related information (#34474)Riley Bruins2025-07-07
|
* fix(diagnostic): fix flaky errorLewis Russell2025-07-04
|
* fix(diagnostics): validate opts.signs #34565Bruce Wen2025-06-18
|
* fix: type fixesLewis Russell2025-06-06
| | | | Type fixes caught by emmylua
* fix(diagnostic): ensure autocmd always is always sent diagnosticsLewis Russell2025-06-05
|
* fix(vim.diagnostic): improve typingLewis Russell2025-06-03
| | | | | | | | | | | | | | | | | | Problem: `vim.diagnostic.set()` doesn't actually accept a list of `vim.Diagnostic` as internally `vim.diagnostic.set()` normalizes the diagnostics and this normalization is assumed throughout the module. Solution: - Add a new type `vim.Diagnostic.Set` which is the input to `vim.diagnostic.set()` - `col` is now an optional field and defaults to `0` to be consistent with `vim.diagnostic.match()`. - Change `table.insert(t, x)` to `table[#table + 1] = x` for improved type checking.
* fix(diagnostics): diagnostic just after EOL is not highlighted #34085Sergei Slipchenko2025-06-03
| | | | | | | | | | | | | | Fixes #34013 Problem: when diagnostic is set right after EOL, underline handler looks inconsistent compared to other handlers, visually underline is shown starting from the next line. On top of that it's also inconsistent with open_float and jump. Solution: clamp starting column position in underline handler to be right before EOL to make it visible and consistent with other handlers, open_float and jump.
* fix: use nvim namespace convention #34010Yochem van Rosmalen2025-05-22
|
* fix(diagnostic): accept multiple namespace in `open_float()` (#34073)Maria José Solano2025-05-21
|
* fix(diagnostics): fixed virtual_text cursormoved autocmd error (#34017)Rijul Kapoor2025-05-21
|
* fix(diagnostic): deprecate `float` in `vim.diagnostic.Opts.Jump` (#34037)v1nh1shungry2025-05-19
|
* feat(diagnostic): add `enabled` filter (#33981)Maria José Solano2025-05-13
|
* feat(diagnostic): add `format` option to `setloclist`/`setqflist` (#33977)Maria José Solano2025-05-12
|
* fix(diagnostic): accept multiple namespaces when setting loclist/qflist (#33982)Maria José Solano2025-05-12
|
* feat(diagnostic): add `on_jump` callback optionMaria José Solano2025-05-05
|
* fix(diagnostic): allow virtual_{lines,text} cursor exclusivity #33517Michael Clayton2025-05-01
| | | | | | | | | | | | | | | | | | | | Problem: virtual_text diagnostics are great when skimming a file, and virtual_lines are great when "zooming in" on a particular problem. Having both enabled results in duplicate diagnostics on-screen. Solution: This PR expands the behavior of `current_line` for virtual_text and virtual_lines by making `virtual_text.current_line = false` distinct from `nil`. If you set: vim.diagnostic.config({ virtual_text = { current_line = false }, virtual_lines = { current_line = true }, }) With this configuration, virtual_text will be used to display diagnostics until the cursor reaches the same line, at which point they will be hidden and virtual_lines will take its place.
* docs(diagnostic): mention `severity` in `Opts.VirtualLines` (#33293)Evgeni Chasnovski2025-04-03
| | | | | | | Problem: `severity` field is recognized by `vim.diagnostic.Opts.VirtualLines`, but it is not explicitly documented. Solution: document it.
* refactor(diagnostic)!: remove deprecated diagnostic APIs (#33072)Gregory Anders2025-03-26
|
* fix(diagnostic): clear virtual_lines autocmd only for valid buf #32979Mars Peng2025-03-19
|
* fix(diagnostic): virtual lines should scroll horizontallyxzb2025-03-16
|
* fix(diagnostic): clear autocmd only for valid buf (#32861)Jaehwang Jung2025-03-12
|
* fix(diagnostic): virtual_lines diagnostic columns (#32703)James Trew2025-03-04
| | | | | When multiple diagnostics appear on a single line, the virtual lines for all diagnostics except the first were rendered with progressively fewer columns.
* fix(diagnostic): don't include diagnostic code when using custom formatter ↵Maria José Solano2025-02-16
| | | | #32464
* feat(diagnostic): add `current_line` option for `virtual_text` handlerMaria José Solano2025-02-05
|
* feat(diagnostic): format() can filter diagnostics by returning nil #32302Maria José Solano2025-02-03
|
* perf(diagnostics): cache line diagnostics when `current_line` is set #32288Maria José Solano2025-02-02
| | | | | Compute the diagnostics per line when `show` is called, allowing for O(1) access for the diagnostics to display when the cursor line or the list of diagnostics haven't changed.
* fix(diagnostic): improve current_line refresh logic #32275Tristan Knight2025-02-02
| | | | | | | | | | | Problem: The current implementation uses a global augroup for virtual lines in diagnostics, which can lead to conflicts and unintended behavior when multiple namespaces/buffers are involved. Solution: Refactor the code to use a namespace-specific augroup for virtual lines. This ensures that each namespace has its own augroup. Scope the clear commands to only the relevant buffer.
* fix: resolve all remaining LuaLS diagnosticsLewis Russell2025-01-27
|
* feat(diagnostic): virtual_lines #31959Maria José Solano2025-01-26
|
* feat(extmarks): virtual text can be right-aligned, truncated #31921georgev932025-01-24
| | | | | | | | | Problem: Right aligned virtual text can cover up buffer text if virtual text is too long Solution: An additional option for `virt_text_pos` called `eol_right_align` has been added to truncate virtual text if it would have otherwise covered up buffer text. This ensures the virtual text extends no further left than EOL.
* fix(diagnostic)!: make virtual text handler opt-in (#32079)Gregory Anders2025-01-18
| | | | | | | | | | | Making this opt-out (on by default) was the wrong choice from the beginning. It is too visually noisy to be enabled by default. BREAKING CHANGE: Users must opt-in to the diagnostic virtual text handler by adding vim.diagnostic.config({ virtual_text = true }) to their config.
* refactor: use nvim.foo.bar format for autocommand groupsMaria José Solano2025-01-14
|
* refactor: use nvim.foo.bar format for namespacesMaria José Solano2025-01-14
|
* feat(diagnostic)!: filter diagnostics by severity before passing to handlers ↵Gregory Anders2025-01-11
| | | | | | | | | | | | | (#30070) BREAKING CHANGE: This changes the list of diagnostics that are passed to a diagnostic handler. If a handler is already filtering by severity itself then this won't break anything, since the handler's filtering will become a no-op. But handlers which depend on receiving the full list of diagnostics may break. Note that diagnostics are only filtered if the handler's configuration has the `severity` option set. If `severity` is not set, the handler still receives the full list of diagnostics.
* fix(diagnostic): silence :chistory #31701Yorick Peterse2024-12-23
| | | | | | | vim.diagnostic.set_list() uses chistory to restore the actively selected entry whenever necessary. This however also results in it displaying some output in the message bar, but this output isn't useful (and can even be distracting) when opening the quickfix window. This fixes this by silencing the chistory command.
* fix(diagnostic): vim.diagnostic.setqflist() opens loclist on first call #31585Juan Cruz De La Torre2024-12-16
| | | | | | | | | | | | Problem: Regression from de794f2d2409: `vim.diagnostic.setqflist{open=true}` attempts to open the location list instead of the diagnostics quickfix list if it didn't exist before. This is because we are using `qf_id` to decide which to open, but `qf_id=nil` when there is no existing diagnostics quickfix list with a given title ("Diagnostics" by default). Solution: - Revert to using `loclist` to decide which to open. - Add tests.
* fix(diagnostic): broken variable reference #31557Jeremy Fleischman2024-12-12
|
* fix(diagnostic): setqflist() is stuck after vim.lsp.buf.document_symbol #31553Jeremy Fleischman2024-12-11
| | | | | | | | | | | | | Previously, when updating the quickfix diagnostics list, we'd update it, and then open the quickfix buffer, but there was no guarantee that the quickfix buffer would be displaying the quickfix diagnostics list (it could very possibly be displaying some other quickfix list!). This fixes things so we first select the quickfix list before opening the quickfix buffer. If `open` is not specified, the behavior is the same as before: we update the diagnostics quickfix list, but do not navigate to it. fixes https://github.com/neovim/neovim/issues/31540
* feat(diagnostic): update quickfix list by title #31486Jeremy Fleischman2024-12-11
| | | | | | | Previously, there was a singleton diagnostics quickfix list. Now there's effectively one per title (up to vim's internal limit on quickfix lists). Suggested by mfussenegger https://github.com/neovim/neovim/pull/30868#pullrequestreview-2385761374.
* refactor: add vim._resolve_bufnrLewis Russell2024-12-07
|
* fix(diagnostic): only store quickfix id when creating a new one #31466Jeremy Fleischman2024-12-05
| | | | | | The old code would always update `_qf_id` with the current quickfix, even if you're currently looking at a completely different, non-diagnostics quickfix list. This completely defeats the intent of <https://github.com/neovim/neovim/pull/30868>, whoops!
* feat(diagnostic): vim.diagnostic.setqflist improvements #30868Jeremy Fleischman2024-12-04
| | | | | | 1. Use the new "u" action to update the quickfix list so we don't lose our position in the quickfix list when updating it. 2. Rather than creating a new quickfix list each time, update the exiting one if we've already created one.
* feat(diagnostic): inherit parent 'path' option in open_float (#31273)Mathias Fußenegger2024-11-25
| | | | | Diagnostics sometimes contain stack traces, it's useful being able to use `CTRL-W F` on them to open related files from within the diagnostic window.
* fix: another round of type annotation fixesLewis Russell2024-10-31
|
* feat(diagnostics)!: sort underline severity_sort (#30898)Donatas2024-10-27
| | | | | feat(diagnostics)!: sort underline with severity_sort BREAKING CHANGE: underline will be applied with a higher value than `vim.hl.priorities.diagnostics`
* feat(vim.validate): improve fast form and deprecate spec formLewis Russell2024-10-21
| | | | | | | | | | | | | | 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.