diff options
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/deprecated.txt | 2 | ||||
-rw-r--r-- | runtime/doc/diagnostic.txt | 16 | ||||
-rw-r--r-- | runtime/doc/news.txt | 5 |
3 files changed, 22 insertions, 1 deletions
diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index 9d32f64aef..0f2dbaa77c 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -90,7 +90,7 @@ For each of the functions below, use the corresponding function in - *vim.lsp.diagnostic.enable()* - *vim.lsp.diagnostic.get()* - *vim.lsp.diagnostic.get_all()* Use |vim.diagnostic.get()| instead. -- *vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.get()| instead. +- *vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.count()| instead. - *vim.lsp.diagnostic.get_line_diagnostics()* Use |vim.diagnostic.get()| instead. - *vim.lsp.diagnostic.get_next()* - *vim.lsp.diagnostic.get_next_pos()* diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index fa5ef22e37..106e130a41 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -481,6 +481,22 @@ config({opts}, {namespace}) *vim.diagnostic.config()* Return: ~ (table|nil) table of current diagnostic config if `opts` is omitted. +count({bufnr}, {opts}) *vim.diagnostic.count()* + Get current diagnostics count. + + Parameters: ~ + • {bufnr} (integer|nil) Buffer number to get diagnostics from. Use 0 + for current buffer or nil for all buffers. + • {opts} (table|nil) A table with the following keys: + • namespace: (number) Limit diagnostics to the given + namespace. + • lnum: (number) Limit diagnostics to the given line number. + • severity: See |diagnostic-severity|. + + Return: ~ + (table) A table with actually present severity values as keys (see + |diagnostic-severity|) and integer counts as values. + disable({bufnr}, {namespace}) *vim.diagnostic.disable()* Disable diagnostics in the given buffer. diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 112a76c013..8efad2454b 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -275,6 +275,11 @@ The following new APIs and features were added. • |v_Q-default| and |v_@-default| repeat a register for each line of a visual selection. +• |vim.diagnostic.count()| returns the number of diagnostics for a given + buffer and/or namespace, by severity. This is a faster alternative to + |vim.diagnostic.get()| when only the number of diagnostics is needed, but + not the diagnostics themselves. + ============================================================================== CHANGED FEATURES *news-changed* |