mirror of
https://github.com/neovim/neovim.git
synced 2026-07-12 20:30:35 +00:00
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:
@@ -520,8 +520,8 @@ end
|
|||||||
|
|
||||||
--- @param bufnr integer
|
--- @param bufnr integer
|
||||||
local function lsp_enable_callback(bufnr)
|
local function lsp_enable_callback(bufnr)
|
||||||
-- Only ever attach to buffers that represent an actual file.
|
-- Only ever attach to buffers (including "help") that represent an actual file.
|
||||||
if vim.bo[bufnr].buftype ~= '' then
|
if vim.bo[bufnr].buftype ~= '' and vim.bo[bufnr].buftype ~= 'help' then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user