diff options
author | Mathias Fussenegger <f.mathias@zignar.net> | 2021-06-06 12:55:41 +0200 |
---|---|---|
committer | Mathias Fussenegger <f.mathias@zignar.net> | 2021-06-07 18:24:32 +0200 |
commit | f03a4d616b2eb22064719a654892cb45d584fe03 (patch) | |
tree | fc79e7838810cdc625281afb0aa42f29d85b9bc9 /runtime/doc | |
parent | f2906a4669a2eef6d7bf86a29648793d63c98949 (diff) | |
download | rneovim-f03a4d616b2eb22064719a654892cb45d584fe03.tar.gz rneovim-f03a4d616b2eb22064719a654892cb45d584fe03.tar.bz2 rneovim-f03a4d616b2eb22064719a654892cb45d584fe03.zip |
feat(lsp): Split out a `diagnostics_to_items` function from set_loclist
Makes it easier to re-use the logic to populate the quickfix list
instead of the location list.
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/lsp.txt | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index dd52fcf22a..531374620a 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1196,11 +1196,16 @@ get({bufnr}, {client_id}) *vim.lsp.diagnostic.get()* diagnostics. Else, return just the diagnostics associated with the client_id. -get_all() *vim.lsp.diagnostic.get_all()* - Get all diagnostics for all clients +get_all({client_id}) *vim.lsp.diagnostic.get_all()* + Get all diagnostics for clients + + Parameters: ~ + {client_id} number Restrict included diagnostics to the + client If nil, diagnostics of all clients are + included. Return: ~ - {bufnr:Diagnostic[]} + table with diagnostics grouped by bufnr (bufnr:Diagnostic[]) *vim.lsp.diagnostic.get_count()* get_count({bufnr}, {severity}, {client_id}) @@ -1725,6 +1730,19 @@ create_file({change}) *vim.lsp.util.create_file()* delete_file({change}) *vim.lsp.util.delete_file()* TODO: Documentation + *vim.lsp.util.diagnostics_to_items()* +diagnostics_to_items({diagnostics_by_bufnr}, {predicate}) + Convert diagnostics grouped by bufnr to a list of items for + use in the quickfix or location list. + + Parameters: ~ + {diagnostics_by_bufnr} table bufnr -> Diagnostic [] + {predicate} an optional function to filter the + diagnostics. + + Return: ~ + table (A list of items) + *vim.lsp.util.extract_completion_items()* extract_completion_items({result}) Can be used to extract the completion items from a `textDocument/completion` request, which may return one of `CompletionItem[]` , `CompletionList` or null. |