Skip to content

Commit 3c8a8ed

Browse files
committed
fix: nvim 0.11
1 parent 51e604b commit 3c8a8ed

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lua/python_import/pyright.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,16 @@ end
107107
---@return table[]
108108
local lsp_to_complete_items = function(result, prefix)
109109
-- TODO: use another function once it's available in public API.
110-
-- See: https://neovim.io/doc/user/deprecated.html#vim.lsp.util.text_document_completion_list_to_complete_items()
110+
if vim.fn.has "nvim-0.11" == 1 then
111+
return vim.lsp.completion._lsp_to_complete_items(result, prefix)
112+
end
113+
114+
-- nvim 0.10
111115
return vim.lsp._completion._lsp_to_complete_items(result, prefix)
116+
117+
-- nvim 0.9 ..
118+
-- See: https://neovim.io/doc/user/deprecated.html#vim.lsp.util.text_document_completion_list_to_complete_items()
119+
-- return vim.lsp.util.text_document_completion_list_to_complete_items(result, prefix)
112120
end
113121

114122
---@param server lspimport.Server

0 commit comments

Comments
 (0)