feat(lsp.util): refactor symbols_to_items()

- Remove the trivial function vim.lsp.util._get_symbol_kind_name()
  and its tests.
This commit is contained in:
Lewis Russell
2024-10-16 09:58:10 +01:00
parent 5bec7288a5
commit f0973d4227
2 changed files with 31 additions and 81 deletions

View File

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