Skip to content

Some plugins for haskell-language-server 8.10.7 are missing #168064

@samhh

Description

@samhh

Describe the bug

The core of haskell-language-server works, and it finds Cabal and GHC in a Nix shell, however HLint and other plugins like formatting providers don't work. I think I'm using the correct HLS package per this user guide.

Steps To Reproduce

My nixpkgs everywhere that follows is recent "unstable".

Steps to reproduce the behavior:

  1. Install pkgs.haskell-language-server globally or via Home Manager. Hook up a LSP-capable editor.
  2. Go into a Haskell project and enter this Nix shell:
{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  buildInputs = with pkgs; [
    cabal-install
    haskell.compiler.ghc8107
  ];
}
  1. With the project building, add the following code:
foo = ("bar")

Expected behavior

HLS should report a HLint warning, like it does if you run hlint <file>:

<file>: Warning: Redundant bracket
Found:
  ("bar")
Perhaps:
  "bar"

1 hint

Additional context

With a formatting provider configured such as stylish-haskell, HLS reports:

hls: -32600: No plugin enabled for STextDocumentFormatting, available: []

HLS seems able to find stuff in the Nix shell environment:

$ haskell-language-server --probe-tools
haskell-language-server version: 1.6.1.1 (GHC: 9.0.2) (PATH: /nix/store/hagqp70hxxrf5kwjsksfm74h7i0s29im-haskell-language-server-1.6.1.1/bin/haskell-language-server)
Tool versions found on the $PATH
cabal:		3.6.2.0
stack:		Not found
ghc:		8.10.7

I've recently migrated from Arch to NixOS with the same editor (Neovim) config. On Arch with GHCup both HLint and stylish-haskell worked. I'm convinced this isn't an editor issue because HLint previously worked without any reference to it in my editor config.

Notify maintainers

Best guess based upon recent hackage-packages.nix activity: @maralorn @sternenseemann @gebner

Metadata

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.17.1, NixOS, 22.05 (Quokka), 22.05.20220406.b6966d9`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.7.0`
 - channels(root): `"nixos"`
 - channels(sam): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: haskellGeneral-purpose, statically typed, purely functional programming language
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions