HI I am still having trouble getting fennel-ls working.
versions info
>uname -a
Darwin XXXX-MBP 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 arm64
> sw_vers
ProductName: macOS
ProductVersion: 14.5
BuildVersion: 23F79
Neovim
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713484068
Mason vim plugin installs luarocks package
fennel-ls@0.1.2-2
external Lua and fennel
Lua 5.1.5
Fennel 1.4.2 on PUC Lua 5.1
I get the following error in nvim
Client fennel_ls quit with exit code 1 and signal 0. Check log for errors: /Users/XXXX/.local/state/nvim/lsp.log
The log file /Users/XXXX/.local/state/nvim/lsp.log
contains the following
[START][2024-07-23 15:09:05] LSP logging initiated
[ERROR][2024-07-23 15:09:05] .../vim/lsp/rpc.lua:770 "rpc" "/Users/XXXX/.local/share/nvim/mason/bin/fennel-ls" "stderr" "/Users/XXXX/.local/share/asdf/installs/lua/5.1.5/bin/lua: ...packages/fennel-ls/share/lua/5.1/fennel-ls/state.lua:86: attempt to index global 'vim' (a nil value)\nstack traceback:\n\t...packages/fennel-ls/share/lua/5.1/fennel-ls/state.lua:86: in function 'make_configuration_from_template'\n\t...packages/fennel-ls/share/lua/5.1/fennel-ls/state.lua:95: in function <...packages/fennel-ls/share/lua/5.1/fennel-ls/state.lua:80>\n\t(tail call): ?\n\t...packages/fennel-ls/share/lua/5.1/fennel-ls/state.lua:136: in function 'init-state'\n\t...kages/fennel-ls/share/lua/5.1/fennel-ls/handlers.lua:66: in function 'callback'\n\t...kages/fennel-ls/share/lua/5.1/fennel-ls/dispatch.lua:17: in function <...kages/fennel-ls/share/lua/5.1/fennel-ls/dispatch.lua:12>\n\t(tail call): ?\n\t...b/luarocks/rocks-5.1/fennel-ls/0.1.2-2/bin/fennel-ls:33: in function <...b/luarocks/rocks-5.1/fennel-ls/0.1.2-2/bin/fennel-ls:28>\n\t(tail call): ?\n\t(tail call): ?\n\t[C]: ?\n”
[START][2024-07-23 15:09:05] LSP logging initiated [ERROR][2024-07-23 15:09:05] .../vim/lsp/rpc.lua:770 "rpc" "/Users/XXXX/.local/share/nvim/mason/bin/fennel-ls" "stderr" "/Users/XXXX/.local/share/asdf/installs/lua/5.1.5/bin/lua: ...packages/fennel-ls/share/lua/5.1/fennel-ls/state.lua:86: attempt to index global 'vim' (a nil value)\nstack traceback:\n\t...packages/fennel-ls/share/lua/5.1/fennel-ls/state.lua:86: in function 'make_configuration_from_template'\n\t...packages/fennel-ls/share/lua/5.1/fennel-ls/state.lua:95: in function <...packages/fennel-ls/share/lua/5.1/fennel-ls/state.lua:80>\n\t(tail call): ?\n\t...packages/fennel-ls/share/lua/5.1/fennel-ls/state.lua:136: in function 'init-state'\n\t...kages/fennel-ls/share/lua/5.1/fennel-ls/handlers.lua:66: in function 'callback'\n\t...kages/fennel-ls/share/lua/5.1/fennel-ls/dispatch.lua:17: in function <...kages/fennel-ls/share/lua/5.1/fennel-ls/dispatch.lua:12>\n\t(tail call): ?\n\t...b/luarocks/rocks-5.1/fennel-ls/0.1.2-2/bin/fennel-ls:33: in function <...b/luarocks/rocks-5.1/fennel-ls/0.1.2-2/bin/fennel-ls:28>\n\t(tail call): ?\n\t(tail call): ?\n\t[C]: ?\n”
Thank you for the report. I will look into this tomorrow!
I'm very confused. I don't see any mention of "vim" in state.lua/state.fnl at all. I also cannot reproduce the issue at all.
The fennel-ls test suite does not pass on PUC 5.1, which could be part of the problem.
Rather than fixing it, I think it would be better to declare PUC 5.1 unsupported and remove it from the CI task.
Does this still happen with the latest? What about if you use a different system lua?
I believe the incompatibilities with 5.1 were addressed a while ago. I'm going to close this out since there is not enough information to reproduce, but we can reopen it if there is still a problem.