Merge #30860 LSP: symbols_to_items()

This commit is contained in:
Justin M. Keyes
2025-02-11 03:38:07 -08:00
committed by GitHub
5 changed files with 61 additions and 21 deletions

View File

@@ -2930,6 +2930,8 @@ describe('LSP', function()
local expected = {
{
col = 1,
end_col = 1,
end_lnum = 2,
filename = '',
kind = 'File',
lnum = 2,
@@ -2937,6 +2939,8 @@ describe('LSP', function()
},
{
col = 1,
end_col = 1,
end_lnum = 4,
filename = '',
kind = 'Module',
lnum = 4,
@@ -2944,6 +2948,8 @@ describe('LSP', function()
},
{
col = 1,
end_col = 1,
end_lnum = 6,
filename = '',
kind = 'Namespace',
lnum = 6,
@@ -3036,7 +3042,7 @@ describe('LSP', function()
},
},
}
return vim.lsp.util.symbols_to_items(doc_syms, nil)
return vim.lsp.util.symbols_to_items(doc_syms, nil, 'utf-16')
end)
)
end)
@@ -3045,6 +3051,8 @@ describe('LSP', function()
local expected = {
{
col = 1,
end_col = 1,
end_lnum = 2,
filename = '',
kind = 'File',
lnum = 2,
@@ -3052,6 +3060,8 @@ describe('LSP', function()
},
{
col = 1,
end_col = 1,
end_lnum = 6,
filename = '',
kind = 'Namespace',
lnum = 6,
@@ -3115,7 +3125,7 @@ describe('LSP', function()
},
},
}
return vim.lsp.util.symbols_to_items(doc_syms, nil)
return vim.lsp.util.symbols_to_items(doc_syms, nil, 'utf-16')
end)
)
end)
@@ -3125,6 +3135,8 @@ describe('LSP', function()
local expected = {
{
col = 1,
end_col = 1,
end_lnum = 3,
filename = '/test_a',
kind = 'File',
lnum = 2,
@@ -3132,6 +3144,8 @@ describe('LSP', function()
},
{
col = 1,
end_col = 1,
end_lnum = 5,
filename = '/test_b',
kind = 'Module',
lnum = 4,
@@ -3181,7 +3195,7 @@ describe('LSP', function()
containerName = 'TestBContainer',
},
}
return vim.lsp.util.symbols_to_items(sym_info, nil)
return vim.lsp.util.symbols_to_items(sym_info, nil, 'utf-16')
end)
)
end)