Giter Club home page Giter Club logo

coc-sumneko-lua's Introduction

coc-sumneko-lua's People

Contributors

dependabot[bot] avatar fannheyward avatar luoyayu avatar nitrocao avatar tortitast avatar wrvsrx avatar xiyaowong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

coc-sumneko-lua's Issues

Incorrect generated type for vim.fn.expand()

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

g:coc_status is always prefixed with 😺Lua

First, thanks for the amazing plugin.

Issue

g:status is always prefixed by 😺Lua

If I set:

  "Lua.window.statusBar": false,
  1. 😺Lua does not appear at first when opening a lua file
  2. as soon as we jump into another lua file (e.g.: "go definition"), the 😺Lua prefix comes back

I love animals, but I really wanna kill this cat 😄

Expected Behavior

No 😺Lua prefix in g:coc_status when "Lua.window.statusBar": false,

Info

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

Call snippets not working

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.

Empty file error

Hi,
When I open an empty lua file before any other files of lua have been opened I get this error

lua_error

Note: If I open the same file when another non-empty lua file is already open than it's all good.

Add Formatter

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.

Cannot open bracket or placeholder when typing keywords

bandicam 2022-02-15 21-43-42-808

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
}

Installing Sumneko Lua returned error

Hi. So I want to use Sumneko's Lua Language Server in Neovim, I encountered a bug were the coc-sumneko-lua can't install Sumneko's Lua Language Server.

Screenshot_20220807-232808_Termux

I'm using Termux with Ubuntu 22.04 Proot (Chroot)

[coc.nvim] Restarting server failed

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 []

Cannot change server directory before installing Sumneko Lua

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

configure work environment as 'luv'

Every time I open the Lua file, the following prompt appears, and typed 1 and 2 both result in the following errors:
2024-01-17_14-52
2024-01-17_14-53

How to make this prompt not appear anymore?

Stuck on "Initializing sumneko-lua"

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.

image

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

Incorrect signature for vim.fn.systemlist

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

neodev.nvim doesn't work

Environment

  • coc-semneko-lua: 0.0.41
  • coc.nvim: 0.0.82
  • neovim: v0.9.5 macOS

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.

async getTypesPath(): Promise<string> {
if (!this.typesExist && !this.autoDownloaded) {
this.autoDownloaded = true;
await this.downloadTypes();
}
if (this.typesExist) {
return path.join(
this.repoDir,
'types',
workspace.isNvim && Boolean(workspace.nvim.call('luaeval', 'vim.version().prerelease')) ? 'nightly' : 'stable'
);
} else {
window.showWarningMessage('Please run command: installNvimLuaTypes');
return '';

Duplicated inlayhints in neovim

There are duplicated inlayhints. It seems the gray one comes from coc-sumneko-lua and the green one comes from coc.nvim. Maybe native inlayhint of coc.nvim should be used?

image

Latest sumneko-lua-ls release seems to have removed Linux/ and macOS/

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'
}

Language server fails to start on systems with incompatible glibc

The lua-language-server binary downloaded upon initialization doesn't work on versions of linux that have a different glibc version.

steps to reproduce

  • rm -rf ~/.config/coc/extensions/coc-sumneko-lua-data # if present
  • nvim +'CocInstall coc-sumneko-lua'
  • open file.lua
  • use option 1 to install language server

Error message

[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)

Workaround

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.

Error on extension loading

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.

Completion for `require` duplicates the last character

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).

image

image

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

  • Windows 10
  • NeoVim 0.8.3
  • coc.nvim 0.0.82-b7375d5f
  • coc-sumneko-lua 0.0.37

Completion doesn't work after using it for a while.

image

Expected:

image

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>

Show loading icon in status bar

After installing this coc extension, it doesn't work anyway. There is one loading icon in the status bar. No idea what's wrong.

image

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.