diff options
| author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2020-04-25 15:46:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-25 15:46:58 +0200 |
| commit | ef0398fe88e6cc74f33fb20519997774168d7832 (patch) | |
| tree | 08dcf126deda4aefeb7fbd016517532896e6973f /runtime/doc | |
| parent | 78d58eaf61b361ed9b2849ecc1afc99897c01058 (diff) | |
| download | rneovim-ef0398fe88e6cc74f33fb20519997774168d7832.tar.gz rneovim-ef0398fe88e6cc74f33fb20519997774168d7832.tar.bz2 rneovim-ef0398fe88e6cc74f33fb20519997774168d7832.zip | |
LSP: Expose diagnostics grouped by bufnr (#11932)
Expose `vim.lsp.buf.diagnostics_by_buf`
This makes it easier to customize the diagnostics behavior. For example
to defer the update they can override the
`textDocument/publishDiagnostics` callback to only call
`buf_diagnostics_save_positions` and then defer the other actions to a
autocmd event.
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/lsp.txt | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 4c59e53343..c7baec0491 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -915,6 +915,21 @@ apply_text_edits({text_edits}, {bufnr}) apply_workspace_edit({workspace_edit}) TODO: Documentation + *vim.lsp.util.diagnostics_by_buf* +diagnostics_by_buf + A table containing diagnostics grouped by buf. + + {<bufnr>: {diagnostics}} + + {diagnostics} is an array of diagnostics. + + By default this is populated by the + `textDocument/publishDiagnostics` callback via + |vim.lsp.util.buf_diagnostics_save_positions|. + + It contains entries for active buffers. Once a buffer is + detached the entries for it are discarded. + buf_clear_diagnostics({bufnr}) *vim.lsp.util.buf_clear_diagnostics()* TODO: Documentation @@ -945,9 +960,14 @@ buf_diagnostics_count({kind}) buf_clear_references({bufnr}) *vim.lsp.util.buf_clear_references()* TODO: Documentation - *vim.lsp.util.buf_diagnostics_save_positions()* + *vim.lsp.util.buf_diagnostics_save()* buf_diagnostics_save_positions({bufnr}, {diagnostics}) - TODO: Documentation + Stores the diagnostics into |vim.lsp.util.diagnostics_by_buf| + + Parameters: ~ + {bufr} bufnr for which the diagnostics are for. + {diagnostics} Diagnostics[] received from the + langauge server. *vim.lsp.util.buf_diagnostics_underline()* buf_diagnostics_underline({bufnr}, {diagnostics}) |