Skip to content

Conflict with nvim-lspconfig v2.1.0Β #465

@Burtannia

Description

@Burtannia

Neovim version (nvim -v)

v0.11.0

Operating system/version

NixOS 25.05

Output of :checkhealth haskell-tools

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

The minimal config used to reproduce this issue.

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",
			},
		},
	},
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions