xiyaowong / coc-sumneko-lua

Lua extension using sumneko lua-language-server for coc.nvim
MIT License
116 stars 11 forks source link

neodev.nvim doesn't work #62

Closed NitroCao closed 6 months ago

NitroCao commented 6 months ago

Environment

Describe the bug

Completion for Neovim Lua APIs doesn't work.

Debug

Add a line in createClient() function to check the value of variable library, it turns out that coc-semneko-lua uses nightly version instead of stable version. CleanShot 2024-04-20 at 21 55 30@2x

The line contains Promise { pending } is from console.log(await import_coc4.workspace.nvim.call('luaeval', 'vim.version().prerelease')); after printing the value of variable library. So we need to add await keyword in getTypesPath() function. https://github.com/xiyaowong/coc-sumneko-lua/blob/5f59b75e3d56c7bcef5d8c44b2828958a921bc69/src/neodev.ts#L33-L46