VSCode config:
{
"[haskell]": {
"editor.defaultFormatter": "haskell.haskell"
},
"haskell.manageHLS": "PATH"
}
Project contains whatever default files are generated via stack init
.
Both haskell.haskell
and justusadam.language-haskell
vscode extensions are installed (from nixpkgs).
2 weeks ago, the following flake.nix
worked fine, including formatting:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
{
devShells.x86_64-linux.default =
let
p = nixpkgs.legacyPackages.x86_64-linux;
in
p.mkShell {
packages = [
(p.haskellPackages.ghcWithPackages (h: [
h.implicit-hie
h.regex-posix
h.split
]))
p.haskell-language-server
p.stack
];
};
};
}
Suddenly today vscode spits out an error from the extension:
Failed to find a HLS version for GHC 9.8.4 Executable names we failed to find: haskell-language-server-9.8.4,haskell-language-server
So I switched to explicitly specifying ghc984:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
{
devShells.x86_64-linux.default =
let
p = nixpkgs.legacyPackages.x86_64-linux;
h = p.haskell.packages.ghc984;
in
p.mkShell {
packages = [
(h.ghcWithPackages (h: [
h.implicit-hie
h.regex-posix
h.split
]))
h.haskell-language-server
h.stack
];
};
};
}
However this wastes 20+ minutes on just compiling over 100 packages and downloading 600 more, and formatting was still broken until I restarted vscode about 6 times and it magically fixed itself.
I’d still like to not have to compile this much on my local machine, can I avoid this and just use whatever’s the default? Why did this error even appear?