mason.nvim
mason.nvim copied to clipboard
feat(registry): add fennel-ls
Closes #867
This PR adds support for the fennel language server.
It's repo is here
And nvim-lspconfig
's entry on it is here
One problem with this implementation is that it relies on the presence of make
in the user's system. This is probably a safe bet on unix systems, but not on windows systems. Are there any suggestions on how to handle this?
One problem with this implementation is that it relies on the presence of make in the user's system. This is probably a safe bet on unix systems, but not on windows systems. Are there any suggestions on how to handle this?
Do you think they'd be open to publishing this package on Luarocks?
I have no idea, but seems like a good solution. I just opened this issue on the repo, and will wait for a response
Since #971 was merged a few months ago, and the owner of fennel-ls has not responded, I'll be closing this PR for now
Apologies for not responding earlier. I am the owner of fennel-ls.
Do you think they'd be open to publishing this package on Luarocks?
I looked into making a LuaRocks package for fennel-ls, but it doesn't seem like it would help with building on Windows.
- if I use
type="builtin"
, there's no way to compile fennel-ls - if I use
type="make"
, we can make a LuaRocks package for fennel-ls, but it doesn't solve the Windows problem because it depends on make. - if I use
type="command"
, there's no way to do specify the alternate command for building on Windows, and apparently you can't set environment variables the same way on Windows and unix. - if I create a custom type of rock (which I did, at luarocks-build-fennel), LuaRocks fails to install if you're using
--tree
(which mason will want to do, as we don't want to touch the system files), because LuaRocks only loads the build types from the system's rocks.
So, I've given up on LuaRocks as a way to make fennel-ls build on windows.
I'm not even sure if fennel-ls can run on Windows at all. Fennel-LS is a Lua script with #!/bin/env lua
at the top, and I don't think Windows will figure out the shebang unless you changed the launch command to lua.exe /path/to/fennel-ls
.
Some alternative ways forward:
- Download the prebuilt script from https://git.sr.ht/~xerool/fennel-ls/refs/download/0.1.0/fennel-ls Unfortunately, it seems like mason would need to update the URL each time a release comes out. I would be happy to send a PR in every time.
- Custom build command.
Instead of triggering
make
, we can hardcode the command that builds the project:lua ./fennel --add-package-path "./src/?.lua" --add-fennel-path "./src/?.fnl" --require-as-include --compile src/fennel-ls.fnl
. This is the command thatmake
would have run anyway. I would be happy to send in a PR every time this changes, and I believe it will be able to build fennel-ls for the forseeable future, but I also understand if this isn't desired. - Decide that fennel-ls works unix only. I'm not sure if there's precedent for this in mason.nvim, but I believe it may be okay to skip Windows support in this case. In the 2023 Fennel Survey, only 6 people claimed to use fennel on Non-WSL Windows, out of 136 responses, so I don't think there's much demand or expectation for fennel tools to work well with Windows.
Good news! LuaRocks seems to have fixed their tree issue, so fennel-ls can work on LuaRocks! 🎉 https://luarocks.org/modules/xerool/fennel-ls
The rock's build mode is build="fennel"
, which doesn't depend on make. If anyone has one of those elusive non-WSL LuaRocks setups, I would appreciate if you could test installing fennel-ls on luarocks.
I'm in control of the "fennel" build mode so it should be easy to get it patched if there are problems on Windows.
I've reopened a request to add fennel-ls to mason. It seems that within the last year, mason.nvim has switched to some crazy yaml system, and moved from this repository to mason-org/mason-registry, so follow the story there: https://github.com/mason-org/mason-registry/pull/4648