From 3a4d3934c4b44c8178a3080553d476894c40d217 Mon Sep 17 00:00:00 2001 From: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Sat, 3 May 2025 16:45:32 +0100 Subject: [PATCH] docs: fixups (#33815) - Add missing diagnostics virtual lines hl groups. - Fix LSP dynamic registration example; curbuf may not actually be attached to the client, and it may be attached to many such buffers. (cherry picked from commit 94bc7f47bf1fefaf2e1f25aabcf04c40882b7d48) --- runtime/doc/diagnostic.txt | 20 ++++++++++++++++++++ runtime/doc/lsp.txt | 6 ++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index efdfd2bfc6..094315d68d 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -269,6 +269,26 @@ DiagnosticVirtualTextHint DiagnosticVirtualTextOk Used for "Ok" diagnostic virtual text. + *hl-DiagnosticVirtualLinesError* +DiagnosticVirtualLinesError + Used for "Error" diagnostic virtual lines. + + *hl-DiagnosticVirtualLinesWarn* +DiagnosticVirtualLinesWarn + Used for "Warn" diagnostic virtual lines. + + *hl-DiagnosticVirtualLinesInfo* +DiagnosticVirtualLinesInfo + Used for "Info" diagnostic virtual lines. + + *hl-DiagnosticVirtualLinesHint* +DiagnosticVirtualLinesHint + Used for "Hint" diagnostic virtual lines. + + *hl-DiagnosticVirtualLinesOk* +DiagnosticVirtualLinesOk + Used for "Ok" diagnostic virtual lines. + *hl-DiagnosticUnderlineError* DiagnosticUnderlineError Used to underline "Error" diagnostics. diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index c3e5674803..8042aad0ad 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -568,8 +568,10 @@ LspAttach *LspAttach* if not client then return end - -- Call your custom on_attach logic... - -- my_on_attach(client, vim.api.nvim_get_current_buf()) + for bufnr, _ in pairs(client.attached_buffers) do + -- Call your custom on_attach logic... + -- my_on_attach(client, bufnr) + end return result end end)(vim.lsp.handlers['client/registerCapability'])