feat(lsp): attach to buftype=help buffers #38412

Problem: `vim.lsp.enable()` skips all buffers with non-empty `buftype`,
including `help` buffers. LSPs targeting `filetype='help'` never
auto-attach despite help buffers being real files.

Solution: Expand the `buftype` guard in `lsp_enable_callback` to allow
`help` alongside `""`.
This commit is contained in:
Barrett Ruth
2026-03-23 07:30:35 -04:00
committed by GitHub
parent d7e534d6b3
commit d6a6eed4f3

View File

@@ -520,8 +520,8 @@ end
--- @param bufnr integer
local function lsp_enable_callback(bufnr)
-- Only ever attach to buffers that represent an actual file.
if vim.bo[bufnr].buftype ~= '' then
-- Only ever attach to buffers (including "help") that represent an actual file.
if vim.bo[bufnr].buftype ~= '' and vim.bo[bufnr].buftype ~= 'help' then
return
end