diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2023-09-14 08:23:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-14 08:23:01 -0500 |
commit | 2e92065686f62851318150a315591c30b8306a4b (patch) | |
tree | 3d4d216f7b031cd2e966380f9b32d1aae472d32f /runtime/lua/vim/diagnostic.lua | |
parent | 9fc321c9768d1a18893e14f46b0ebacef1be1db4 (diff) | |
download | rneovim-2e92065686f62851318150a315591c30b8306a4b.tar.gz rneovim-2e92065686f62851318150a315591c30b8306a4b.tar.bz2 rneovim-2e92065686f62851318150a315591c30b8306a4b.zip |
docs: replace <pre> with ``` (#25136)
Diffstat (limited to 'runtime/lua/vim/diagnostic.lua')
-rw-r--r-- | runtime/lua/vim/diagnostic.lua | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index a1f3020c88..b8d3906b7f 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -553,14 +553,16 @@ end --- followed by namespace configuration, and finally global configuration. --- --- For example, if a user enables virtual text globally with ---- <pre>lua ---- vim.diagnostic.config({ virtual_text = true }) ---- </pre> +--- +--- ```lua +--- vim.diagnostic.config({ virtual_text = true }) +--- ``` --- --- and a diagnostic producer sets diagnostics with ---- <pre>lua ---- vim.diagnostic.set(ns, 0, diagnostics, { virtual_text = false }) ---- </pre> +--- +--- ```lua +--- vim.diagnostic.set(ns, 0, diagnostics, { virtual_text = false }) +--- ``` --- --- then virtual text will not be enabled for those diagnostics. --- @@ -1601,18 +1603,20 @@ end --- Parse a diagnostic from a string. --- --- For example, consider a line of output from a linter: ---- <pre> +--- +--- ``` --- WARNING filename:27:3: Variable 'foo' does not exist ---- </pre> +--- ``` --- --- This can be parsed into a diagnostic |diagnostic-structure| --- with: ---- <pre>lua ---- local s = "WARNING filename:27:3: Variable 'foo' does not exist" ---- local pattern = "^(%w+) %w+:(%d+):(%d+): (.+)$" ---- local groups = { "severity", "lnum", "col", "message" } ---- vim.diagnostic.match(s, pattern, groups, { WARNING = vim.diagnostic.WARN }) ---- </pre> +--- +--- ```lua +--- local s = "WARNING filename:27:3: Variable 'foo' does not exist" +--- local pattern = "^(%w+) %w+:(%d+):(%d+): (.+)$" +--- local groups = { "severity", "lnum", "col", "message" } +--- vim.diagnostic.match(s, pattern, groups, { WARNING = vim.diagnostic.WARN }) +--- ``` --- ---@param str string String to parse diagnostics from. ---@param pat string Lua pattern with capture groups. |