Questions tagged [haskell-language-server]

Questions about haskell-language-server, or HLS for short, an LSP implementation which provides IDE tooling for Haskell.

22 questions
6
votes
0 answers

GHCup installed with HLS (latest) doesn't work with VS Code HLS Extension for Intellisense

Context: I run a Windows machine, and I've installed the Haskell Toolchain using GHCup. Initially, I selected "Y" to all the options mentioned during setup. Stack, Cabal, ghc (8.10.7 - recommended) worked and were/are on path (installation…
2
votes
1 answer

Haskell-language-server starting in wrong folder in VS Code

I have a project that looks like this: - my-project - backend - stack.yaml - src - ... a bunch of haskell files - ... exe & test folders here too - frontend - ... an Elm frontend app - flake.nix - ... other files When…
2
votes
0 answers

Configure haskell-language-server to see generated proto-lens modules

I've got a fairly stock stack based project that uses proto-lens-setup to generate some Haskell code from some .proto files. I'm using haskell-language-server with wonderful success in emacs for everything except when my code imports any of the…
2
votes
2 answers

GHCI needlessly recompiles sub-package

I have a project (let's call it parent) that has a sub-package (child). Using HLS from emacs, whenever I change a file in the parent that imports part of the child package, and try to load it, GHCI will recompile the whole sub-package again every…
2
votes
0 answers

In Nix, how to tell `haskell-language-server` to enable a flag in current project?

My Nix project's cabal file defines a flag but leaves it disabled by default: flag with-examples description: Include examples and their dependencies default: False But when I run haskell-language-server in the nix-shell, it says: Hidden: …
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
2
votes
0 answers

VSCode - Haskell - Go to definition - no definition found?

I installed Haskell tools, ghc and ghci, Haskell Language Server with ghcup. I also have VSCode Haskell extension installed. How can I get VSCode to navigate me to a function definition? With current setup it returns no definition found.
matcheek
  • 4,887
  • 9
  • 42
  • 73
1
vote
2 answers

How to get a working Haskell VS Code setup with ghcup?

I installed Haskell via ghcup I have installed the HLS via ghcup I have ghcup set 9.6.1 I have the VS Code extension: https://marketplace.visualstudio.com/items?itemName=haskell.haskell When I open the project in VS Code I get the following…
Anentropic
  • 32,188
  • 12
  • 99
  • 147
1
vote
1 answer

Why did HSL extension stop working on VS Code?

I am using Windows 11. I've been using Haskell with VS Code. Suddenly yesterday it stopped giving me problems section (one that displays syntax errors and such before code is compiled). I am using Haskells own extension (ID: haskell.haskell). I am…
Heikki
  • 341
  • 2
  • 18
1
vote
1 answer

`Haskell` extension for `VSCode` not working on `Linux`

I installed ghcup and: Stack 2.9.1 HLS 1.8.0 cabal 3.6.2 GHC 9.2.5 All of them are the recommended versions(I verified it using ghcup tui). Then I installed the Haskell extension in VSCode. Unfortunately, it doesn't work. I get syntax highlighting…
1
vote
0 answers

different behavior from haskell-language-server-wrapper from emacs vs command line

If I call the haskell-language-server-wrapper from the command line in the main folder of my project (created with stack), I get the outputs below. Not sure what the for "/Users/ar/Temp/lixo/a" means, but it seems to work as expected. But, in the…
Alexandre Rademaker
  • 2,683
  • 2
  • 19
  • 21
1
vote
1 answer

Why does a project created with stack new @ GHC 9.0.2 crash the language server?

I am completely new to haskell. From what I've gathered so far about the tool chain, cabal and Stack are competing build/package management tools. The answers to this question were quite informative. I was happy to learn that haskell has a mature…
thisisrandy
  • 2,660
  • 2
  • 12
  • 25
1
vote
1 answer

VSCode Haskell Extension Error: `ghcup --no-verbose upgrade` exited with exit code ENOENT

When opening a Haskell file with VSCodium (I don't think that makes a difference), I get the error `ghcup --no-verbose upgrade` exited with exit code ENOENT. Here's the full log from the Extension Output: [client] INFO Finding…
1
vote
1 answer

Set VSCode's $PATH variable

I am trying to use the Haskell extension, but it isn't using the correct path. For those who haven't used Haskell before, one way of using it is installing GHCup, then using it to install GHC (the compiler) and Cabal (a Haskell build system) (or if…
1
vote
1 answer

VScode Haskell Go To Definition doesn't work for some symbols

I'm getting started with Haskell and VSCode. I've forked and downloaded a repo with Haskell code. I've followed instructions for setting up a nix-shell correctly for this repo. I can successfully invoke cabal build and haskell-language-server for…
Paymahn Moghadasian
  • 9,301
  • 13
  • 56
  • 94
1
vote
1 answer

New functions are not detected by vscode Haskell extension

I have the following Visual Studio Code extensions for Haskell installed: Let's say I create a new stack project: stack new vscode-red-squiggly-test And setup Lib.hs and Main.hs as follows: This builds and runs just fine: stack build stack exec…
dharmatech
  • 8,979
  • 8
  • 42
  • 88
1
2