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 94bc7f47bf)
This commit is contained in:
Sean Dewar
2025-05-03 16:45:32 +01:00
parent 2b2a3449f7
commit 3a4d3934c4
2 changed files with 24 additions and 2 deletions

View File

@@ -269,6 +269,26 @@ DiagnosticVirtualTextHint
DiagnosticVirtualTextOk DiagnosticVirtualTextOk
Used for "Ok" diagnostic virtual text. 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* *hl-DiagnosticUnderlineError*
DiagnosticUnderlineError DiagnosticUnderlineError
Used to underline "Error" diagnostics. Used to underline "Error" diagnostics.

View File

@@ -568,8 +568,10 @@ LspAttach *LspAttach*
if not client then if not client then
return return
end end
-- Call your custom on_attach logic... for bufnr, _ in pairs(client.attached_buffers) do
-- my_on_attach(client, vim.api.nvim_get_current_buf()) -- Call your custom on_attach logic...
-- my_on_attach(client, bufnr)
end
return result return result
end end
end)(vim.lsp.handlers['client/registerCapability']) end)(vim.lsp.handlers['client/registerCapability'])