diff options
Diffstat (limited to 'runtime/doc/diagnostic.txt')
-rw-r--r-- | runtime/doc/diagnostic.txt | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index 19db3158be..32936a7ee6 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -39,16 +39,18 @@ modify the diagnostics for a buffer (e.g. |vim.diagnostic.set()|) then it requires a namespace. *diagnostic-structure* -A diagnostic is a Lua table with the following keys: +A diagnostic is a Lua table with the following keys. Required keys are +indicated with (*): bufnr: Buffer number - lnum: The starting line of the diagnostic + lnum(*): The starting line of the diagnostic end_lnum: The final line of the diagnostic - col: The starting column of the diagnostic + col(*): The starting column of the diagnostic end_col: The final column of the diagnostic severity: The severity of the diagnostic |vim.diagnostic.severity| - message: The diagnostic text + message(*): The diagnostic text source: The source of the diagnostic + code: The diagnostic code user_data: Arbitrary data plugins or users can add Diagnostics use the same indexing as the rest of the Nvim API (i.e. 0-based @@ -72,7 +74,7 @@ Functions that take a severity as an optional parameter (e.g. 2. A table with a "min" or "max" key (or both): > - vim.diagnostic.get(0, { severity = {min=vim.diagnostic.severity.WARN}) + vim.diagnostic.get(0, { severity = {min=vim.diagnostic.severity.WARN} }) The latter form allows users to specify a range of severities. @@ -326,11 +328,11 @@ config({opts}, {namespace}) *vim.diagnostic.config()* Note: Each of the configuration options below accepts one of the following: - • `false` : Disable this feature - • `true` : Enable this feature, use default settings. - • `table` : Enable this feature with overrides. Use an + • `false`: Disable this feature + • `true`: Enable this feature, use default settings. + • `table`: Enable this feature with overrides. Use an empty table to use default values. - • `function` : Function with signature (namespace, bufnr) + • `function`: Function with signature (namespace, bufnr) that returns any of the above. Parameters: ~ |