Sublime Text

Credits

This guide assumes that you've completed the steps described in Prerequisites.

  1. If you're using nix-shell, make sure you can launch the editor from the command line so it inherits your $PATH. Follow the instructions here.
  2. Install LSP: Open the command palette and run Package Control: Install Package, then select LSP.
  3. Open LSP settings: Preferences -> Package Settings -> LSP -> Settings and add this
    {
     "clients": {
         "haskell-language-server": {
           "command": ["haskell-language-server", "--lsp"],
           "scopes": ["source.haskell"],
           "syntaxes": ["Packages/Haskell/Haskell.sublime-syntax"],
           "languageId": "haskell",
           "enabled": true
         },
     }
    }
    
  4. Close the editor and re-open it in the project folder
    cd <your-projects-dir>
    subl .
    
    Note: if you're using nix-shell, make sure to run it first.

If everything is fine you should get auto-completion and other features working 🎉