Issues with setting up HLS + Vim

This page summarizes the projects mentioned and recommended in the original post on

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • - Download’s Tech Salary Report
  • Scout APM - Less time debugging, more time building
  • SonarLint - Clean code begins in your IDE with SonarLint
  • coc.nvim

    Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.

    Hi Reddit, I'm a first time vim user trying to get Haskell working on it. I've installed coc.nvim, and added this to my coc configuration: json { "languageserver": { "haskell": { "command": "haskell-language-server-wrapper", "args": ["--lsp"], "rootPatterns": ["*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml"], "filetypes": ["haskell", "lhaskell"] } } } This runs single .hs files, hurray! Unfortunately though, if I want to use an external library (in my case using stack), I get hit with an error Could not find module .... I feel like this issue is due to HLS not knowing what the project root is, thus not loading my project.yaml and stack.yaml files, despite it being defined as a root pattern in the coc settings.

  • haskell-language-server

    Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.

    For the second question, if you use the compiled binaries, checkout the release page of HLS. For each version of HLS, there's a list of different GHC versions' binaries. You need to use a version with the same GHC version of your project.

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • direnv

    unclutter your .profile

    If you need different GHC versions of HLS for different projects (as I often encounter), you can either use Nix or simply direnv to dynamically link the binary to the correct version of HLS.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts