From ee41153a945876ad0c7f0927ffa7b5a5afdaca89 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Tue, 30 Apr 2024 09:57:31 +0100 Subject: feat(diagnostic): revert default behaviour of goto_next/prev() Follow-up to #28490 Problem: The new behaviour of goto_next/prev() of navigating to the next highest severity doesn't work well when diagnostic providers have different interpretations of severities. E.g. the user may be blocked from navigating to a useful LSP warning, due to some linter error. Solution: The behaviour of next highest severity is now a hidden option `_highest = true`. We can revisit how to integrate this behaviour during the 0.11 cycle. --- test/functional/lua/diagnostic_spec.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/functional/lua/diagnostic_spec.lua') diff --git a/test/functional/lua/diagnostic_spec.lua b/test/functional/lua/diagnostic_spec.lua index 2e6f7fbf36..05082bc132 100644 --- a/test/functional/lua/diagnostic_spec.lua +++ b/test/functional/lua/diagnostic_spec.lua @@ -962,7 +962,7 @@ describe('vim.diagnostic', function() eq( { 3, 0 }, exec_lua([[ - vim.diagnostic.goto_next() + vim.diagnostic.goto_next({_highest = true}) return vim.api.nvim_win_get_cursor(0) ]]) ) @@ -970,7 +970,7 @@ describe('vim.diagnostic', function() eq( { 5, 0 }, exec_lua([[ - vim.diagnostic.goto_next() + vim.diagnostic.goto_next({_highest = true}) return vim.api.nvim_win_get_cursor(0) ]]) ) @@ -991,7 +991,7 @@ describe('vim.diagnostic', function() eq( { 4, 0 }, exec_lua([[ - vim.diagnostic.goto_next() + vim.diagnostic.goto_next({_highest = true}) return vim.api.nvim_win_get_cursor(0) ]]) ) @@ -999,7 +999,7 @@ describe('vim.diagnostic', function() eq( { 6, 0 }, exec_lua([[ - vim.diagnostic.goto_next() + vim.diagnostic.goto_next({_highest = true}) return vim.api.nvim_win_get_cursor(0) ]]) ) @@ -1021,7 +1021,7 @@ describe('vim.diagnostic', function() eq( { 2, 0 }, exec_lua([[ - vim.diagnostic.goto_next({ severity = { min = vim.diagnostic.severity.HINT } }) + vim.diagnostic.goto_next() return vim.api.nvim_win_get_cursor(0) ]]) ) @@ -1029,7 +1029,7 @@ describe('vim.diagnostic', function() eq( { 3, 0 }, exec_lua([[ - vim.diagnostic.goto_next({ severity = { min = vim.diagnostic.severity.HINT } }) + vim.diagnostic.goto_next() return vim.api.nvim_win_get_cursor(0) ]]) ) @@ -1037,7 +1037,7 @@ describe('vim.diagnostic', function() eq( { 4, 0 }, exec_lua([[ - vim.diagnostic.goto_next({ severity = { min = vim.diagnostic.severity.HINT } }) + vim.diagnostic.goto_next() return vim.api.nvim_win_get_cursor(0) ]]) ) -- cgit