diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/plugin/lsp/diagnostic_spec.lua | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/test/functional/plugin/lsp/diagnostic_spec.lua b/test/functional/plugin/lsp/diagnostic_spec.lua index b7e292cad0..5afbe22793 100644 --- a/test/functional/plugin/lsp/diagnostic_spec.lua +++ b/test/functional/plugin/lsp/diagnostic_spec.lua @@ -120,85 +120,6 @@ describe('vim.lsp.diagnostic', function() end) describe('vim.lsp.diagnostic.on_publish_diagnostics', function() - it('allows configuring the virtual text via vim.lsp.with', function() - local expected_spacing = 10 - local extmarks = exec_lua(function() - _G.PublishDiagnostics = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = { - spacing = expected_spacing, - }, - }) - - _G.PublishDiagnostics(nil, { - uri = fake_uri, - diagnostics = { - _G.make_error('Delayed Diagnostic', 4, 4, 4, 4), - }, - }, { client_id = client_id }) - - return _G.get_extmarks(diagnostic_bufnr, client_id) - end) - - local spacing = extmarks[1][4].virt_text[1][1] - - eq(expected_spacing, #spacing) - end) - - it('allows configuring the virtual text via vim.lsp.with using a function', function() - local expected_spacing = 10 - local extmarks = exec_lua(function() - _G.PublishDiagnostics = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = function() - return { - spacing = expected_spacing, - } - end, - }) - - _G.PublishDiagnostics(nil, { - uri = fake_uri, - diagnostics = { - _G.make_error('Delayed Diagnostic', 4, 4, 4, 4), - }, - }, { client_id = client_id }) - - return _G.get_extmarks(diagnostic_bufnr, client_id) - end) - - local spacing = extmarks[1][4].virt_text[1][1] - - eq(expected_spacing, #spacing) - end) - - it('allows filtering via severity limit', function() - local get_extmark_count_with_severity = function(severity_limit) - return exec_lua(function() - _G.PublishDiagnostics = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - underline = false, - virtual_text = { - severity = { min = severity_limit }, - }, - }) - - _G.PublishDiagnostics(nil, { - uri = fake_uri, - diagnostics = { - _G.make_warning('Delayed Diagnostic', 4, 4, 4, 4), - }, - }, { client_id = client_id }) - - return #_G.get_extmarks(diagnostic_bufnr, client_id) - end, client_id, fake_uri, severity_limit) - end - - -- No messages with Error or higher - eq(0, get_extmark_count_with_severity('ERROR')) - - -- But now we don't filter it - eq(1, get_extmark_count_with_severity('WARN')) - eq(1, get_extmark_count_with_severity('HINT')) - end) - it('correctly handles UTF-16 offsets', function() local line = 'All 💼 and no 🎉 makes Jack a dull 👦' local result = exec_lua(function() @@ -380,34 +301,6 @@ describe('vim.lsp.diagnostic', function() eq(1, diagnostics[1].severity) end) - it('allows configuring the virtual text via vim.lsp.with', function() - local expected_spacing = 10 - local extmarks = exec_lua(function() - _G.Diagnostic = vim.lsp.with(vim.lsp.diagnostic.on_diagnostic, { - virtual_text = { - spacing = expected_spacing, - }, - }) - - _G.Diagnostic(nil, { - kind = 'full', - items = { - _G.make_error('Pull Diagnostic', 4, 4, 4, 4), - }, - }, { - params = { - textDocument = { uri = fake_uri }, - }, - uri = fake_uri, - client_id = client_id, - }, {}) - - return _G.get_extmarks(diagnostic_bufnr, client_id) - end) - eq(2, #extmarks) - eq(expected_spacing, #extmarks[1][4].virt_text[1][1]) - end) - it('clears diagnostics when client detaches', function() exec_lua(function() vim.lsp.diagnostic.on_diagnostic(nil, { |