xiyaowong / coc-sumneko-lua Goto Github PK
View Code? Open in Web Editor NEWLua extension using sumneko lua-language-server for coc.nvim
License: MIT License
Lua extension using sumneko lua-language-server for coc.nvim
License: MIT License
expand()
has the signature expand({string} [, {nosuf} [, {list}]])
, where list
is a boolean representing whether the output should be a list. Currently it seems that the type generator operates based on parameter names, and assumes this list
parameter is of type list, which is incorrect.
The generator doesn't currently support manual overrides, which I think this would probably need.
generated definition:
--- @param list any[]
function vim.fn.expand(expr, nosuf, list) end
First, thanks for the amazing plugin.
g:status
is always prefixed by 😺Lua
If I set:
"Lua.window.statusBar": false,
😺Lua
does not appear at first when opening a lua file😺Lua
prefix comes backI love animals, but I really wanna kill this cat 😄
No 😺Lua
prefix in g:coc_status
when "Lua.window.statusBar": false,
coc-sumneko-lua 0.0.12
vim version: NVIM v0.7.0-dev+809-ge42c90659
node version: v17.2.0
coc.nvim version: 0.0.80-f6a947a8eb
coc.nvim directory: /home/antoine/.local/share/nvim/site/pack/packer/start/coc.nvim
term: xterm-256color
platform: linux
I've enabled enableNvimLuaDev
:
vim.fn['coc#config']('sumneko-lua', {
enableNvimLuaDev = true
})
But while I edit my init.lua
, even though everything seems to be working, both completion and diagnostics, I'm getting lots of "Undefined global `vim`"
for code with vim.
. Previously I was using coc-lua with this lua-dev.nvim
configuration and was not getting this warning:
Call snippets, which have been enabled on folke/neodev.nvim@a267319, is not working. It works with the following coc-lua configuration:
vim.fn['coc#config']('Lua', require('lua-dev').setup{}.settings.Lua)
Thanks for the plugin.
Something that's really annoying me with this (great) plugin, is that there is no formatter. I know the sumneko language server has no formatter, but I think it would be a great idea to add a different one, to allow formatting lua files.
Currently the interpreter on the binary builds of sumneko-lua is not present on NixOS. rust-analyzer has the same problem and they fix it by doing this in their code: https://github.com/rust-lang/rust-analyzer/blob/76030ebdeaf759a5d9948ece4ba16092d0039c95/editors/code/src/main.ts#L216
How to permanently disable the prompt that pops up when opening a .lua file:
Preloaded files has reached the upper limit (0), you need to manually open the files that need to be loaded.
(1)[object Object]:
+ @chemzqm
I'm using scoop install lua-for-windows
for lua. Currently, it's lua5.1.5
. It just happens for lua, pyright, and rust-analyzer works normal.
vim version:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 2 2021 18:02:30)
MS-Windows 32-bit console version
Included patches: 1-2824
Compiled by mool@tororo
Huge version without GUI. Features included (+) or not (-):
+acl +comments +find_in_path +listcmds +popupwin -sun_workshop +vertsplit
+arabic +conceal +float +localmap -postscript +syntax +virtualedit
+autocmd +cryptv +folding -lua +printer +tag_binary +visual
+autochdir +cscope -footer +menu +profile -tag_old_static +visualextra
+autoservername +cursorbind +gettext/dyn +mksession -python -tag_any_white +viminfo
-balloon_eval +cursorshape -hangul_input +modify_fname -python3 -tcl +vreplace
+balloon_eval_term +dialog_con +iconv/dyn +mouse +quickfix +termguicolors +vtp
-browse +diff +insert_expand -mouseshape +reltime +terminal +wildignore
++builtin_terms +digraphs +ipv6 +multi_byte_ime/dyn +rightleft -termresponse +wildmenu
+byte_offset -dnd +job +multi_lang -ruby +textobjects +windows
+channel -ebcdic +jumplist -mzscheme +scrollbind +textprop +writebackup
+cindent +emacs_tags +keymap -netbeans_intg +signs -tgetent -xfontset
+clientserver +eval +lambda +num64 +smartindent +timers -xim
+clipboard +ex_extra +langmap +packages +sound +title -xpm_w32
+cmdline_compl +extra_search +libcall +path_extra +spell -toolbar -xterm_save
+cmdline_hist -farsi +linebreak -perl +startuptime +user_commands
+cmdline_info +file_in_path +lispindent +persistent_undo +statusline +vartabs
system vimrc file: "$VIM\vimrc"
user vimrc file: "$HOME\_vimrc"
2nd user vimrc file: "$HOME\vimfiles\vimrc"
3rd user vimrc file: "$VIM\_vimrc"
user exrc file: "$HOME\_exrc"
2nd user exrc file: "$VIM\_exrc"
defaults file: "$VIMRUNTIME\defaults.vim"
Compilation: cl -c /W3 /GF /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DFEAT_TERMINAL -DFEAT_SOUND -DFEAT_JOB_CHANNEL -DFEAT_IPV6 -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 /source-charset:utf-8 /MP -DHAVE_STDINT_H /Ox /GL -DNDEBUG /arch:IA32 /Zl /MT /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_HUGE /Fd.\ObjCi386/ /Zi
Linking: link /nologo /opt:ref /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib netapi32.lib uuid.lib /machine:i386 libcmt.lib user32.lib winmm.lib WSock32.lib Ws2_32.lib /PDB:vim.pdb -debug
CocConfig:
{
"suggest.noselect": false,
"snippets.priority": 99,
"vimlsp.trace.server": "verbose",
"vimlsp.debug": true,
"coc.preferences.formatOnType": true,
"coc.preferences.formatOnTypeFiletypes": ["c", "rust"],
"coc.preferences.formatOnSaveFiletypes": ["python", "c", "rust"],
"rust-analyzer.cargo.unsetTest": [
"derivative"
],
"python.formatting.provider": "black",
"python.formatting.blackPath": "C:/Users/hungpham/scoop/apps/python/current/Scripts/black.exe",
"python.linting.pylintArgs": ["--generate-members"],
"python.linting.flake8Enabled": true,
"rust-analyzer.inlayHints.typeHints": true,
"rust-analyzer.inlayHints.refreshOnInsertMode": true,
"powershell.integratedConsole.showOnStartup": false,
"sumneko-lua.inlayHints.refreshOnInsertMode": true
}
I set "sumneko-lua.enableNvimLuaDev": true
on the Windows,
but I didn't get the completion function similar to that demonstrated in GIF.
Since the release v3.5.6 of vscode-lua
I get the following errors opening any lua file:
[coc.nvim] Restarting server failed
followed by
[coc.nvim] Pending response rejected since connection got disposed
The language server does not work after such error messages, neither the completions nor the go-to-definition and such. Do you happen to have an idea about what can cause such failures? The message is quite obscure, but all other CoC
plugins work as expected (so it is about coc-sumneko-lua
after all).
On further inspection, by using :CocOpenLog
I see the following log message for the exception:
2022-09-21T01:58:58.127 INFO (pid:12856) [services] - registered service "sumneko-lua"
2022-09-21T01:58:58.130 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: stopped => starting
2022-09-21T01:58:58.130 INFO (pid:12856) [plugin] - coc.nvim initialized with node: v18.9.0 after 142ms
2022-09-21T01:58:58.140 INFO (pid:12856) [language-client-index] - Language server "sumneko-lua" started with 12865
2022-09-21T01:58:58.167 ERROR (pid:12856) [language-client] - Sending request failed.
2022-09-21T01:58:58.168 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: starting => stopped
2022-09-21T01:58:58.168 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: stopped => starting
2022-09-21T01:58:58.169 ERROR (pid:12856) [language-client-client] - Server sumneko-lua initialization failed. Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:58:58.170 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: starting => stopped
2022-09-21T01:58:58.170 ERROR (pid:12856) [extensions-manager] - Error on active extension coc-sumneko-lua: Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:58:58.170 ERROR (pid:12856) [extensions-manager] - Error on activate coc-sumneko-lua Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:58:58.171 ERROR (pid:12856) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-09-21T01:58:58.173 INFO (pid:12856) [language-client-index] - Language server "sumneko-lua" started with 12866
2022-09-21T01:58:58.178 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: stopped => starting
2022-09-21T01:58:58.179 ERROR (pid:12856) [language-client-client] - Server sumneko-lua initialization failed. Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:58:58.179 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: starting => stopped
2022-09-21T01:58:58.179 ERROR (pid:12856) [services] - Server sumneko-lua failed to start: Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:58:58.180 ERROR (pid:12856) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-09-21T01:58:58.181 INFO (pid:12856) [language-client-index] - Language server "sumneko-lua" started with 12868
2022-09-21T01:58:58.186 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: stopped => starting
2022-09-21T01:58:58.187 ERROR (pid:12856) [language-client-client] - Server sumneko-lua initialization failed. Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:58:58.187 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: starting => stopped
2022-09-21T01:58:58.188 ERROR (pid:12856) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-09-21T01:58:58.189 INFO (pid:12856) [language-client-index] - Language server "sumneko-lua" started with 12869
2022-09-21T01:58:58.194 ERROR (pid:12856) [language-client-client] - Server sumneko-lua initialization failed. Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:58:58.195 ERROR (pid:12856) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-09-21T01:59:01.591 INFO (pid:12856) [attach] - Request action: listNames []
2022-09-21T01:59:01.749 INFO (pid:12856) [attach] - Request action: listNames []
2022-09-21T01:59:01.838 INFO (pid:12856) [attach] - Request action: listNames []
2022-09-21T01:59:01.957 INFO (pid:12856) [attach] - Request action: listNames []
2022-09-21T01:59:02.355 INFO (pid:12856) [attach] - receive notification: openList [ 'commands' ]
2022-09-21T01:59:14.438 INFO (pid:12856) [attach] - Request action: listNames []
2022-09-21T01:59:14.596 INFO (pid:12856) [attach] - Request action: listNames []
2022-09-21T01:59:14.675 INFO (pid:12856) [attach] - Request action: listNames []
2022-09-21T01:59:14.764 INFO (pid:12856) [attach] - Request action: listNames []
2022-09-21T01:59:14.989 INFO (pid:12856) [attach] - Request action: listNames []
2022-09-21T01:59:15.491 INFO (pid:12856) [attach] - receive notification: openList [ 'commands' ]
2022-09-21T01:59:22.814 INFO (pid:12856) [services] - registered service "sumneko-lua"
2022-09-21T01:59:22.814 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: stopped => starting
2022-09-21T01:59:22.816 INFO (pid:12856) [language-client-index] - Language server "sumneko-lua" started with 12876
2022-09-21T01:59:22.821 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: starting => stopped
2022-09-21T01:59:22.821 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: stopped => starting
2022-09-21T01:59:22.821 ERROR (pid:12856) [language-client-client] - Server sumneko-lua initialization failed. Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:59:22.821 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: starting => stopped
2022-09-21T01:59:22.822 ERROR (pid:12856) [list-session] - Error on action run Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:59:22.822 ERROR (pid:12856) [node-client] - Pending response rejected since connection got disposed Error: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
2022-09-21T01:59:22.822 ERROR (pid:12856) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-09-21T01:59:22.824 INFO (pid:12856) [language-client-index] - Language server "sumneko-lua" started with 12877
2022-09-21T01:59:22.828 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: stopped => starting
2022-09-21T01:59:22.829 ERROR (pid:12856) [language-client-client] - Server sumneko-lua initialization failed. Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:59:22.829 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: starting => stopped
2022-09-21T01:59:22.829 ERROR (pid:12856) [services] - Server sumneko-lua failed to start: Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:59:22.829 ERROR (pid:12856) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-09-21T01:59:22.831 INFO (pid:12856) [language-client-index] - Language server "sumneko-lua" started with 12878
2022-09-21T01:59:22.836 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: stopped => starting
2022-09-21T01:59:22.836 ERROR (pid:12856) [language-client-client] - Server sumneko-lua initialization failed. Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:59:22.836 INFO (pid:12856) [services] - LanguageClient Sumneko Lua Language Server state change: starting => stopped
2022-09-21T01:59:22.837 ERROR (pid:12856) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-09-21T01:59:22.838 INFO (pid:12856) [language-client-index] - Language server "sumneko-lua" started with 12879
2022-09-21T01:59:22.844 ERROR (pid:12856) [language-client-client] - Server sumneko-lua initialization failed. Gm [Error]: Pending response rejected since connection got disposed
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:50:4562)
at Object.dispose (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:215:89956)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10821)
at gf.handleConnectionClosed (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:224:3604)
at t (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:220:10473)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230)
at Re (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:24:6501)
at KA.invoke (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:14460)
at Xd.fire (/Users/gennaro/.config/nvim/plugged/coc.nvim/build/index.js:23:15230) {
code: -32097,
data: undefined
}
2022-09-21T01:59:22.845 ERROR (pid:12856) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-09-21T01:59:28.547 INFO (pid:12856) [attach] - receive notification: openLog []
Hello, so I have a problem with changing server directory. I can't use sumneko-lua.serverDir
before installing Sumneko Lua.
Here's the output:
[coc.nvim] Error on notification "runCommand": Command: sumneko-lua.serverDir
not found
Press ENTER or type command to continue
So I just removed coc-lua
because I couldn't figure out ignoring globals, and hear good things about coc-sumneko-lua
.
Opening a bare minimum lua
file, though, sumneko-lua never stops initializing.
I haven't adjusted any settings yet, my coc-settings.json
is incredibly minimal and unrelated to lua:
{
"suggest.autoTrigger": "none",
"diagnostic.enable": true,
"python.pythonPath": "/usr/bin/python"
}
So, curious, anything I should be configuring here? Could you point me to the relevant bits of any documentation, if so?
Cheers
It seems that builtin-docs.json
has somehow got the wrong signature in it for systemlist():
"systemlist": [
"{cmd} [, {input}]",
"List"
],
It should have a third parameter keepempty
per the help page:
systemlist({cmd} [, {input} [, {keepempty}]]) *systemlist()*
Generated type:
--- @return list
function vim.fn.systemlist(cmd, input) end
Completion for Neovim Lua APIs doesn't work.
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.
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.
Lines 33 to 46 in 5f59b75
It show message: [coc.nvim] Download Sumneko lua language server failed
2021-12-17T12:42:52.401 ERROR (pid:82802) [extension:coc-sumneko-lua] - [Error: ENOENT: no such file or directory, chmod '/home/francisco/.config/coc/extensions/coc-sumneko-lua-data/sumneko-lua-ls/extension/server/bin/Linux/lua-language-server'] {
errno: -2,
code: 'ENOENT',
syscall: 'chmod',
path: '/home/francisco/.config/coc/extensions/coc-sumneko-lua-data/sumneko-lua-ls/extension/server/bin/Linux/lua-language-server'
}
Maybe this is similar solved as in (I have no idea same solution can help, but the issue is the same):
The lua-language-server
binary downloaded upon initialization doesn't work on versions of linux that have a different glibc version.
[coc.nvim]: UnhandledRejection: write EPIPE
Error: write EPIPE
at afterWriteDispatched (internal/stream_base_commons.js:156:25)
at writeGeneric (internal/stream_base_commons.js:147:3)
at Socket._writeGeneric (net.js:798:11)
at Socket._write (net.js:810:8)
at writeOrBuffer (internal/streams/writable.js:358:12)
at Socket.Writable.write (internal/streams/writable.js:303:10)
at /home/user/.config/nvim/plugged/coc.nvim/build/index.js:35:3107
at new Promise (<anonymous>)
at DF.write (/home/user/.config/nvim/plugged/coc.nvim/build/index.js:35:3028)
at QS.doWrite (/home/user/.config/nvim/plugged/coc.nvim/build/index.js:36:1698)
Unfortunately, coc.nvim doesn't provide good feedback when the language server fails, so it took a while to figure out what was wrong. It becomes clear when running the executable directly.
$ cd ~/.config/coc/extensions/coc-sumneko-lua-data/sumneko-lua-ls/extension/server/bin/Linux
$ ./lua-language-server
./lua-language-server: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.27' not found (required by ./lua-language-server)
./lua-language-server: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./lua-language-server)
For people encountering this issue, you can simply replace the lua-language-server
executable with one you've compiled against the locally available glibc.
$ git clone [email protected]:sumneko/lua-language-server.git #follow build instructions
$ cd 3rd/luamake && ./compile/install.sh && cd ../.. && ./3rd/luamake/luamake rebuild && cp bin/Linux/lua-language-server ~/.config/coc/extensions/coc-sumneko-lua-data/sumneko-lua-ls/extension/server/bin/Linux/
It seems like this project is assuming every linux system has the same libraries.
This happens on version 0.0.12. When Installing and opening a lua file:
[coc.nvim]: UnhandledRejection: write EPIPE
Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:160:15)
at writeGeneric (node:internal/stream_base_commons:151:3)
at Socket._writeGeneric (node:net:795:11)
at Socket._write (node:net:807:8)
at writeOrBuffer (node:internal/streams/writable:390:12)
at _write (node:internal/streams/writable:331:10)
at Socket.Writable.write (node:internal/streams/writable:335:10)
at /home/jtcf/.vim/plugged/coc.nvim/build/index.js:35:3107
at new Promise (<anonymous>)
at xF.write (/home/jtcf/.vim/plugged/coc.nvim/build/index.js:35:3028)
[coc.nvim]: UnhandledRejection: Cannot call write after a stream was destroyed
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
at new NodeError (node:internal/errors:371:5)
at _write (node:internal/streams/writable:322:11)
at Socket.Writable.write (node:internal/streams/writable:335:10)
at /home/jtcf/.vim/plugged/coc.nvim/build/index.js:35:3107
at new Promise (<anonymous>)
at xF.write (/home/jtcf/.vim/plugged/coc.nvim/build/index.js:35:3028)
at GS.doWrite (/home/jtcf/.vim/plugged/coc.nvim/build/index.js:36:1698)
at /home/jtcf/.vim/plugged/coc.nvim/build/index.js:36:1597
After this "Initializing sumneko-lua" appears on status bar, but it never initializes.
Thanks for the awesome plugin :)
Please look at next screenshots. Here I want to complete module name rc.config
. The situation after confirming completion is shown in the next screenshot. As you can see, confirming completion (coc#_select_confirm()
) adds extra character g
(the last character of completed module name).
This issue does not appear neither in neovim built-in LSP (with nvim-cmp) nor VSCode, but appears in coc-lua too.
Completion doesn't work after using it for a while.
Expected:
Here is coc.vim's error log
2023-03-01T10:40:20.531 ERROR (pid:22844) [completion-complete] - Complete error: sumneko-lua jh [Error]
at C:\Users\IGG\AppData\Local\nvim-data\plugged\coc.nvim\build\index.js:51:3652
at new Promise (<anonymous>)
at Object.sendRequest (C:\Users\IGG\AppData\Local\nvim-data\plugged\coc.nvim\build\index.js:51:3401)
at Object.sendRequest (C:\Users\IGG\AppData\Local\nvim-data\plugged\coc.nvim\build\index.js:241:5768)
at Nd.sendRequest (C:\Users\IGG\AppData\Local\nvim-data\plugged\coc.nvim\build\index.js:244:1921)
at runNextTicks (node:internal/process/task_queues:60:5)
at process.processImmediate (node:internal/timers:446:9)
at async Am.doComplete (C:\Users\IGG\AppData\Local\nvim-data\plugged\coc.nvim\build\index.js:257:6457) {
code: -32603,
data: undefined
}
Here is sumneko/vscode-lua's error log
[16:04:31.377][error][#0:script\core\completion\auto-require.lua:61]: script\core\completion\auto-require.lua:61: attempt to index a nil value
stack traceback:
script\core\completion\auto-require.lua:61: in function 'core.completion.auto-require.check'
script\core\completion\completion.lua:407: in upvalue 'checkModule'
script\core\completion\completion.lua:1457: in upvalue 'tryWord'
script\core\completion\completion.lua:2231: in upvalue 'tryCompletions'
script\core\completion\completion.lua:2247: in function 'core.completion.completion.completion'
script\provider\provider.lua:622: in function <script\provider\provider.lua:597>
[C]: in function 'xpcall'
script\proto\proto.lua:191: in function <script\proto\proto.lua:166>
coc-settings.json
{
"Lua.diagnostics.lowercase-global": false
}
这个配置不起效果。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.