From 451bc50d40ee43a40285d16039deb83c9bf05ff6 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Thu, 8 Feb 2024 12:11:47 +0000 Subject: feat(lsp): deprecate severity_limit Problem: `vim.lsp.diagnostic.on_diagnostic` accepts an undocumented severity_limit option which is widely used. Solution: Deprecate it in favour of `{min = severity}` used in `vim.diagnostic`. Since this is undocumented, the schedule for removal is accelerated to 0.11. --- test/functional/plugin/lsp/diagnostic_spec.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/functional/plugin') diff --git a/test/functional/plugin/lsp/diagnostic_spec.lua b/test/functional/plugin/lsp/diagnostic_spec.lua index ee8dfc7a60..705c182df7 100644 --- a/test/functional/plugin/lsp/diagnostic_spec.lua +++ b/test/functional/plugin/lsp/diagnostic_spec.lua @@ -193,7 +193,7 @@ describe('vim.lsp.diagnostic', function() PublishDiagnostics = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { underline = false, virtual_text = { - severity_limit = ... + severity = { min = ... } }, }) @@ -212,11 +212,11 @@ describe('vim.lsp.diagnostic', function() end -- No messages with Error or higher - eq(0, get_extmark_count_with_severity('Error')) + eq(0, get_extmark_count_with_severity('ERROR')) -- But now we don't filter it - eq(1, get_extmark_count_with_severity('Warning')) - eq(1, get_extmark_count_with_severity('Hint')) + eq(1, get_extmark_count_with_severity('WARN')) + eq(1, get_extmark_count_with_severity('HINT')) end) it('correctly handles UTF-16 offsets', function() -- cgit