Conflict with nvim-lspconfig v2.1.0
upstream (hls)upstream (neovim)
### Neovim version (nvim -v)
v0.11.0
### Operating system/version
NixOS 25.05
### Output of :checkhealth haskell-tools
```console
haskell-tools: require("haskell-tools.health").check()
Checking for Lua dependencies ~
- ✅ OK [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) installed.
Checking external dependencies ~
- ✅ OK haskell-language-server: found nix (Nix) 2.28.2
- ✅ OK hoogle: found Hoogle 5.0.18.4, https://hoogle.haskell.org/
- ✅ OK fast-tags: found fast-tags, version 2.0.2
- ✅ OK curl: found curl 8.12.1 (x86_64-pc-linux-gnu) libcurl/8.12.1 OpenSSL/3.4.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.7 libidn2/2.3.8 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.65.0
- ⚠️ WARNING haskell-debug-adapter: not found.
Install [haskell-debug-adapter](https://github.com/phoityne/haskell-debug-adapter) for extended capabilities.
Optional, for `dap` support.
- ⚠️ WARNING ghci-dap: not found.
Install [ghci-dap](https://github.com/phoityne/ghci-dap) for extended capabilities.
Optional, for `dap` support.
Checking config ~
- ✅ OK No errors found in config.
Checking for conflicting plugins ~
- ✅ OK No conflicting plugins detected.
```
### How to reproduce the issue
1) Open a Haskell file.
2) Hit `<leader>f` to format.
3) Run `:LspInfo`
### Expected behaviour
Formatted via `fourmolu` respecting the project's `fourmolu.yaml`. This was the behaviour before v5.0.0.
Expected no errors from `:LspInfo`.
### Actual behaviour
Formatted via some default, presumably `ormolu`.
`:LspInfo` produces:
```
==============================================================================
vim.lsp: require("vim.lsp.health").check()
- LSP log level : WARN
- Log path: /home/burtannia/.local/state/nvim/lsp.log
- Log size: 87974 KB
vim.lsp: Active Clients ~
- ❌ ERROR Failed to run healthcheck for "vim.lsp" plugin. Exception:
Vim:E729: Using a Funcref as a String
```
I believe this is down to `haskell-tools` since running `hls` via `lspconfig` with an identical config works fine:
```
lspconfig.hls.setup({
on_attach = on_attach,
cmd = { "nix", "run", ".#hls", "--", "--lsp" },
settings = {
haskell = {
formattingProvider = "fourmolu",
},
},
})
```
### Log files
```console
```
### The minimal config used to reproduce this issue.
```Lua
local on_attach = function(_, bufnr)
bufmap("<leader>f", function()
vim.lsp.buf.format({ async = true })
end)
end
vim.g.haskell_tools = {
hls = {
on_attach = on_attach,
cmd = { "nix", "run", ".#hls", "--", "--lsp" },
settings = {
haskell = {
formattingProvider = "fourmolu",
},
},
},
}
```
关闭于 2025-04-30 9 条评论