refactor(diagnostic): split diagnostic module

Extract the diagnostic implementation from
runtime/lua/vim/diagnostic.lua into focused internal modules covering
config, display, float rendering, jump/list helpers, namespace and
storage management, severity/shared utilities, and statusline support.

Move the builtin handlers into runtime/lua/vim/diagnostic/handlers/ and
keep runtime/lua/vim/diagnostic.lua as the public facade that lazily
dispatches to the split modules. This preserves the external
vim.diagnostic API while making the implementation easier to navigate
and reason about.

AI-assisted: Codex
This commit is contained in:
Lewis Russell
2026-04-02 17:27:49 +01:00
committed by Lewis Russell
parent 9e80f63c30
commit 1f53abf54b
10 changed files with 2418 additions and 2072 deletions

View File

@@ -3492,7 +3492,7 @@ describe('vim.diagnostic', function()
)
eq(
'.../diagnostic.lua:0: prefix: expected string|table|function, got number',
'.../_float.lua:0: prefix: expected string|table|function, got number',
pcall_err(exec_lua, [[ vim.diagnostic.open_float({ prefix = 42 }) ]])
)
end)
@@ -3549,7 +3549,7 @@ describe('vim.diagnostic', function()
)
eq(
'.../diagnostic.lua:0: suffix: expected string|table|function, got number',
'.../_float.lua:0: suffix: expected string|table|function, got number',
pcall_err(exec_lua, [[ vim.diagnostic.open_float({ suffix = 42 }) ]])
)
end)