From f0973d42272e9474c758c87697e3803e1796d17c Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Wed, 16 Oct 2024 09:58:10 +0100 Subject: feat(lsp.util): refactor symbols_to_items() - Remove the trivial function vim.lsp.util._get_symbol_kind_name() and its tests. --- test/functional/plugin/lsp_spec.lua | 38 ------------------------------------- 1 file changed, 38 deletions(-) (limited to 'test') diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index 0ab384a032..5309e1967c 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -3134,44 +3134,6 @@ describe('LSP', function() end) end) - describe('lsp.util._get_symbol_kind_name', function() - it('returns the name specified by protocol', function() - eq( - 'File', - exec_lua(function() - return vim.lsp.util._get_symbol_kind_name(1) - end) - ) - eq( - 'TypeParameter', - exec_lua(function() - return vim.lsp.util._get_symbol_kind_name(26) - end) - ) - end) - - it('returns the name not specified by protocol', function() - eq( - 'Unknown', - exec_lua(function() - return vim.lsp.util._get_symbol_kind_name(nil) - end) - ) - eq( - 'Unknown', - exec_lua(function() - return vim.lsp.util._get_symbol_kind_name(vim.NIL) - end) - ) - eq( - 'Unknown', - exec_lua(function() - return vim.lsp.util._get_symbol_kind_name(1000) - end) - ) - end) - end) - describe('lsp.util.jump_to_location', function() local target_bufnr --- @type integer -- cgit From acbc6a7f91d15fe5f59df08227d196156fafedb4 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Wed, 16 Oct 2024 13:17:10 +0100 Subject: fix(lsp.util): inconsistent handling of offset_encoding --- test/functional/plugin/lsp_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index 5309e1967c..6cd433b975 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -2586,7 +2586,7 @@ describe('LSP', function() }, }, } - eq(false, pcall(exec_lua, 'vim.lsp.util.apply_workspace_edit(...)', edit)) + eq(false, pcall(exec_lua, 'vim.lsp.util.apply_workspace_edit(...)', edit, 'utf-16')) eq(false, vim.uv.fs_stat(tmpfile) ~= nil) end) end) -- cgit