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.
This commit is contained in:
Lewis Russell
2024-02-08 12:11:47 +00:00
committed by Lewis Russell
parent 5c36701228
commit 451bc50d40
3 changed files with 29 additions and 32 deletions

View File

@@ -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()