@@ -359,7 +359,11 @@ lsp.document_symbols = function(opts)
359
359
return
360
360
end
361
361
362
- local locations = vim .lsp .util .symbols_to_items (result or {}, opts .bufnr ) or {}
362
+ if vim .fn .has " nvim-0.11" == 1 then
363
+ local locations = vim .lsp .util .symbols_to_items (result or {}, opts .bufnr , " utf-8" ) or {}
364
+ else
365
+ local locations = vim .lsp .util .symbols_to_items (result or {}, opts .bufnr ) or {}
366
+ end
363
367
locations = utils .filter_symbols (locations , opts , symbols_sorter )
364
368
if vim .tbl_isempty (locations ) then
365
369
-- error message already printed in `utils.filter_symbols`
@@ -402,7 +406,11 @@ lsp.workspace_symbols = function(opts)
402
406
return
403
407
end
404
408
405
- local locations = vim .lsp .util .symbols_to_items (server_result or {}, opts .bufnr ) or {}
409
+ if vim .fn .has " nvim-0.11" == 1 then
410
+ local locations = vim .lsp .util .symbols_to_items (server_result or {}, opts .bufnr , " utf-8" ) or {}
411
+ else
412
+ local locations = vim .lsp .util .symbols_to_items (server_result or {}, opts .bufnr ) or {}
413
+ end
406
414
locations = utils .filter_symbols (locations , opts , symbols_sorter )
407
415
if vim .tbl_isempty (locations ) then
408
416
-- error message already printed in `utils.filter_symbols`
@@ -452,7 +460,11 @@ local function get_workspace_symbols_requester(bufnr, opts)
452
460
if client_res .error then
453
461
vim .api .nvim_err_writeln (" Error when executing workspace/symbol : " .. client_res .error .message )
454
462
elseif client_res .result ~= nil then
455
- vim .list_extend (locations , vim .lsp .util .symbols_to_items (client_res .result , bufnr ))
463
+ if vim .fn .has " nvim-0.11" == 1 then
464
+ vim .list_extend (locations , vim .lsp .util .symbols_to_items (client_res .result , bufnr , " utf-8" ))
465
+ else
466
+ vim .list_extend (locations , vim .lsp .util .symbols_to_items (client_res .result , bufnr ))
467
+ end
456
468
end
457
469
end
458
470
0 commit comments