HLS isn't using hlint or stylish-haskell
hls: -32600: No plugin enabled for STextDocumentFormatting, available: []
Can/should this be configured per-project via Nix? Not sure how comfortably that can interoperate with my nvim config.
Possibly should be per-project: https://haskell4nix.readthedocs.io/nixpkgs-users-guide.html#how-to-install-haskell-language-server
Be careful when installing hls globally and using a pinned nixpkgs for a Haskell project in a nix-shell. If the nixpkgs versions deviate to much (e.g. use different glibc versions) hls might fail. It is recommended to then install hls in the nix-shell from the nixpkgs version pinned in there.
If you know, that you only use one ghc version, e.g. in a project specific nix-shell You can either use an override as given above or simply install pkgs.haskellPackages.haskell-language-server instead of the top-level attribute pkgs.haskell-language-server.
Tried building from scratch like so and still no HLint:
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = with pkgs.haskell.packages.ghc8107; [
cabal-install
ghc
haskell-language-server
hlint
# stylish-haskell
];
shellHook = ''
export NIX_GHC="${pkgs.haskell.packages.ghc8107.ghc}/bin/ghc"
export NIX_GHCPKG="${pkgs.haskell.packages.ghc8107.ghc}/bin/ghc-pkg"
export NIX_GHC_DOCDIR="${pkgs.haskell.packages.ghc8107.ghc}/share/doc/ghc/html"
export NIX_GHC_LIBDIR="${pkgs.haskell.packages.ghc8107.ghc}/lib/ghc-$($NIX_GHC --numeric-version)"
'';
}
Had some trouble with stylish-haskell hence commenting it out. hls-hlint-plugin also failed to build.
No idea. https://github.com/NixOS/nixpkgs/issues/168064
FYI: https://github.com/NixOS/nixpkgs/pull/191987.
On a recent nixpkgs-unstable HLS targeting GHC 9.0.2 HLint now works, but stylish-haskell still doesn't. Might be an issue specific to stylish-haskell; tempted to look at other formatters anyway.
stylish-haskell is working now too. :blush: