{"id":13688677,"url":"https://github.com/haskell/vscode-haskell","last_synced_at":"2026-02-24T12:05:17.631Z","repository":{"id":37966619,"uuid":"69105338","full_name":"haskell/vscode-haskell","owner":"haskell","description":"VS Code extension for Haskell, powered by haskell-language-server","archived":false,"fork":false,"pushed_at":"2025-05-05T01:46:19.000Z","size":2488,"stargazers_count":574,"open_issues_count":47,"forks_count":90,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-08T17:01:59.067Z","etag":null,"topics":["haskell","haskell-language-server","language-server","lsp","visual-studio-code","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=haskell.haskell","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haskell.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":"docs/Contributing.md","funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-09-24T13:56:00.000Z","updated_at":"2025-05-04T19:00:29.000Z","dependencies_parsed_at":"2024-01-15T20:55:48.309Z","dependency_job_id":"c6759e42-03d0-439f-9349-1e888e503dea","html_url":"https://github.com/haskell/vscode-haskell","commit_stats":{"total_commits":973,"total_committers":74,"mean_commits":13.14864864864865,"dds":0.7183967112024666,"last_synced_commit":"51b45a201fb0bb942a4b5ed108d720f896e25707"},"previous_names":[],"tags_count":81,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell%2Fvscode-haskell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell%2Fvscode-haskell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell%2Fvscode-haskell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell%2Fvscode-haskell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haskell","download_url":"https://codeload.github.com/haskell/vscode-haskell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254283339,"owners_count":22045140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","haskell-language-server","language-server","lsp","visual-studio-code","vscode","vscode-extension"],"created_at":"2024-08-02T15:01:19.759Z","updated_at":"2026-02-24T12:05:17.597Z","avatar_url":"https://github.com/haskell.png","language":"TypeScript","readme":"# Haskell for Visual Studio Code\n\n[![vsmarketplacebadge](https://vsmarketplacebadges.dev/version/haskell.haskell.png)](https://marketplace.visualstudio.com/items?itemName=haskell.haskell)\n\nThis extension adds language support for [Haskell](https://haskell.org), powered by the [Haskell Language Server](https://github.com/haskell/haskell-language-server).\nAs almost all features are provided by the server you might find interesting read its [documentation](https://haskell-language-server.readthedocs.io).\n\n## Table of Contents\n\n- [Haskell for Visual Studio Code](#haskell-for-visual-studio-code)\n  - [Table of Contents](#table-of-contents)\n  - [Setup](#setup)\n  - [Features](#features)\n  - [Requirements](#requirements)\n  - [Configuration options](#configuration-options)\n    - [Path to server executable](#path-to-server-executable)\n      - [Security warning](#security-warning)\n    - [Set additional environment variables for the server](#set-additional-environment-variables-for-the-server)\n    - [Downloaded binaries](#downloaded-binaries)\n    - [Setting a specific toolchain](#setting-a-specific-toolchain)\n    - [Supported GHC versions](#supported-ghc-versions)\n  - [Using multi-root workspaces](#using-multi-root-workspaces)\n  - [Investigating and reporting problems](#investigating-and-reporting-problems)\n  - [FAQ](#faq)\n    - [Troubleshooting](#troubleshooting)\n      - [Check issues and tips in the haskell-language-server project](#check-issues-and-tips-in-the-haskell-language-server-project)\n      - [Restarting the language server](#restarting-the-language-server)\n      - [`Failed to get project GHC version` on darwin M1 with stack](#failed-to-get-project-ghc-version-on-darwin-m1-with-stack)\n      - [`GHC ABIs don't match`](#ghc-abis-dont-match)\n      - [Using an old configuration](#using-an-old-configuration)\n      - [Stack/Cabal/GHC can not be found](#stackcabalghc-can-not-be-found)\n  - [Contributing](#contributing)\n  - [Release Notes](#release-notes)\n\n## Setup\n\nThis Extension comes with \"batteries\"-included and can manage your Haskell Language Server installations for you,\npowered by [GHCup](https://www.haskell.org/ghcup/).\nInstallation of [GHCup](https://www.haskell.org/ghcup/) can not happen automatically, so if you want your HLS installations to be\nmanaged by the Extension, you will have to follow the [installation instructions for GHCup](https://www.haskell.org/ghcup/).\n\n**Note:** Make sure you have a working `ghcup` installation, before launching the Extension.\n\n## Features\n\nYou can watch demos for some of these features [here](https://haskell-language-server.readthedocs.io/en/latest/features.html#demos).\n\n- Warning and error diagnostics from GHC\n- Type information and documentation on hover\n- Jump to definition: [for now only for local code definitions](https://github.com/haskell/haskell-language-server/issues/708)\n- Document symbols\n- Highlight references in document\n- Code completion\n- Show documentation and sources in hackage\n- Formatting via [Brittany](https://github.com/lspitzner/brittany), [Floskell](https://github.com/ennocramer/floskell), [Fourmolu](https://github.com/fourmolu/fourmolu), [Ormolu](https://github.com/tweag/ormolu) or [Stylish Haskell](https://github.com/haskell/stylish-haskell)\n- [Multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) support\n- [Code evaluation](https://haskell-language-server.readthedocs.io/en/latest/features.html#code-evaluation), see its [Tutorial](https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-eval-plugin/README.md)\n- [Integration with](https://haskell-language-server.readthedocs.io/en/latest/features.html#retrie-integration) [retrie](https://hackage.haskell.org/package/retrie), a powerful, easy-to-use codemodding tool\n- [Code lenses for explicit import lists](https://haskell-language-server.readthedocs.io/en/latest/features.html#explicit-import-lists)\n- [Generate functions from type signatures, and intelligently complete holes using](https://haskell-language-server.readthedocs.io/en/latest/features.html#wingman) [Wingman (tactics)](https://github.com/haskell/haskell-language-server/tree/master/plugins/hls-tactics-plugin)\n- [Integration](https://haskell-language-server.readthedocs.io/en/latest/features.html#hlint) with [hlint](https://github.com/ndmitchell/hlint), the most used haskell linter, to show diagnostics and apply hints via [apply-refact](https://github.com/mpickering/apply-refact)\n- [Module name suggestions](https://haskell-language-server.readthedocs.io/en/latest/features.html#module-names) for insertion or correction\n- [Call hierarchy support](https://haskell-language-server.readthedocs.io/en/latest/features.html#call-hierarchy)\n\n## Requirements\n\n- For standalone `.hs`/`.lhs` files, [ghc](https://www.haskell.org/ghc/) must be installed and on the PATH. The easiest way to install it is with [ghcup](https://www.haskell.org/ghcup/).\n- For Cabal based projects, both ghc and [cabal-install](https://www.haskell.org/cabal/) must be installed and on the PATH. It can also be installed with [ghcup](https://www.haskell.org/ghcup/) or [Chocolatey](https://www.haskell.org/platform/windows.html) on Windows.\n- For Stack based projects, [stack](http://haskellstack.org) must be installed and on the PATH and must be [configured to use GHC binaries installed by GHCup](https://www.haskell.org/ghcup/guide/#stack-integration).\n- If you are installing from an offline VSIX file, you need to install [language-haskell](https://github.com/JustusAdam/language-haskell) too after installation (either from the marketplace or offline).\n- Alternatively, you can let the extension manage your entire toolchain automatically (you'll be asked on first startup) via\n  [ghcup](https://www.haskell.org/ghcup/), which should be pre-installed\n\n## Configuration options\n\nFor a general picture about the server configuration, including the project setup, [you can consult the server documentation about the topic](https://haskell-language-server.readthedocs.io/en/latest/configuration.html).\n\nFor information on how to set configuration in VSCode, see [here](https://code.visualstudio.com/docs/getstarted/settings).\n\n### Path to server executable\n\nIf your server is manually installed and not on your path, you can also manually set the path to the executable.\n\n```json\n\"haskell.serverExecutablePath\": \"~/.local/bin/haskell-language-server\"\n```\n\nThere are a few placeholders which will be expanded:\n\n- `~`, `${HOME}` and `${home}` will be expanded into your users' home folder.\n- `${workspaceFolder}` and `${workspaceRoot}` will expand into your current project root.\n\n#### Security warning\n\nThe option has `machine-overridable` scope so it can be changed per workspace.\nThis supposes it could be used to execute arbitrary programs adding a `.vscode/settings.json` in the workspace folder including this option with the appropriate path.\nSee [#387](https://github.com/haskell/vscode-haskell/issues/387) for more details.\n\n### Set additional environment variables for the server\n\nYou can add additional environment variables for the lsp server using the configuration option `haskell.serverEnvironment`. For example, to change the cache directory used by the server you could set:\n\n```json\n{ \"haskell.serverEnvironment\": { \"XDG_CACHE_HOME\": \"/path/to/my/cache\" } }\n```\n\nas the server uses the XDG specification for cache directories.\n\nThe environment _only will be visible for the lsp server_, not for other extension tasks like find the server executable.\n\n### Downloaded binaries\n\nThis extension will download `haskell-language-server` binaries and the rest of the toolchain if you selected to use GHCup during\nfirst start. Check the `haskell.manageHLS` setting.\n\nIt will then download the newest version of haskell-language-server which has support for the required ghc.\nThat means it could use an older version than the latest one, without the last features and bug fixes.\nFor example, if a project needs ghc-8.10.4 the extension will download and use haskell-language-server-1.4.0, the latest version which supported ghc-8.10.4. Even if the latest global haskell language-server version is 1.5.1.\n\nIf you have disk space issues, check `ghcup gc --help`.\n\nYou can also instruct the extension to use a different installation directory for the toolchain,\ne.g. to not interfere with system GHCup installation. Depending on your platform, add the full\nresolved path like so:\n\n```json\n  \"haskell.serverEnvironment\": {\n    \"GHCUP_INSTALL_BASE_PREFIX\": \"/home/foo/.config/Code/User/globalStorage/haskell.haskell/\"\n  }\n```\n\nThe internal storage paths for the extension depend on the platform:\n\n| Platform | Path                                                                            |\n| -------- | ------------------------------------------------------------------------------- |\n| macOS    | `~/Library/Application\\ Support/Code/User/globalStorage/haskell.haskell/.ghcup` |\n| Windows  | `%APPDATA%\\Code\\User\\globalStorage\\haskell.haskell\\ghcup`                       |\n| Linux    | `$HOME/.config/Code/User/globalStorage/haskell.haskell/.ghcup`                  |\n\nIf you want to manage HLS yourself, set `haskell.manageHLS` to `PATH` and make sure HLS is in your PATH\nor set `haskell.serverExecutablePath` (overrides all other settings) to a valid executable.\n\nIf you need to set mirrors for ghcup download info, check the settings `haskell.metadataURL` and `haskell.releasesURL`.\n\n### Setting a specific toolchain\n\nWhen `manageHLS` is set to `GHCup`, you can define a specific toolchain (`hls`, `ghc`, `cabal` and `stack`),\neither globally or per project. E.g.:\n\n```json\n{\n  \"haskell.toolchain\": {\n    \"hls\": \"1.6.1.1\",\n    \"cabal\": \"recommended\",\n    \"stack\": null\n  }\n}\n```\n\nThis means:\n\n1. install the `ghc` version corresponding to the project (default, because it's omitted)\n2. install `hls` 1.6.1.1\n3. install the recommended `cabal` version from ghcup\n4. don't install any `stack` version\n\nAnother config could be:\n\n```json\n{\n  \"haskell.toolchain\": {\n    \"ghc\": \"9.2.2\",\n    \"hls\": \"latest\",\n    \"cabal\": \"recommended\"\n  }\n}\n```\n\nMeaning:\n\n1. install `ghc` 9.2.2 regardless of what the project requires\n2. always install latest `hls`, even if it doesn't support the given GHC version\n3. install recommended `cabal`\n4. install latest `stack` (default, because it's omitted)\n\nThe defaults (when omitted) are as follows:\n\n1. install the project required `ghc` (corresponding to `with-compiler` setting in `cabal.project` for example)\n2. install the latest `hls` version that supports the project required ghc version\n3. install latest `cabal`\n4. install latest `stack`\n\nWhen a the value is `null`, the extension will refrain from installing it.\n\nAt last, if you don't want `ghcup` to manage any of the external tools except `hls`, you can use:\n\n```json\n{\n  \"haskell.toolchain\": {\n    \"ghc\": null,\n    \"cabal\": null,\n    \"stack\": null\n  }\n}\n```\n\n### Supported GHC versions\n\nYou can check each GHC version's support status and the policy followed for deprecations [here](https://haskell-language-server.readthedocs.io/en/latest/support/ghc-version-support.html).\n\n[Building from source](https://haskell-language-server.readthedocs.io/en/latest/installation.html) may support more versions!\n\nThe exact list of binaries can be checked in the last release of haskell-language-server: \u003chttps://github.com/haskell/haskell-language-server/releases/latest\u003e\n\n## Using multi-root workspaces\n\nFirst, check out [what multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces) are. The idea of using multi-root workspaces, is to be able to work on several different Haskell projects, where the GHC version or stackage LTS could differ, and have it work smoothly.\n\nThe language server is now started for each workspace folder you have in your multi-root workspace, and several configurations are on a resource (i.e. folder) scope, instead of window (i.e. global) scope.\n\n## Investigating and reporting problems\n\n1. Go to extensions and right click `Haskell` and choose `Extensions Settings`\n2. Scroll down to `Haskell › Trace: Server` and set it to `messages`.\n3. Set `Haskell › Trace: Client` to `debug`. It will print all the environment variables so take care it does not contain any sensitive information before sharing it.\n4. Restart vscode and reproduce your problem\n5. Go to the main menu and choose `View -\u003e Output` (`Ctrl + Shift + U`)\n6. On the new Output panel that opens on the right side in the drop down menu choose `Haskell (\u003cyour project\u003e)`\n\nPlease include the output when filing any issues on the [haskell-language-server](https://github.com/haskell/haskell-language-server/issues/new) issue tracker.\n\n## FAQ\n\n### Troubleshooting\n\n#### Check issues and tips in the haskell-language-server project\n\n- Usually the error or unexpected behaviour is already reported in the [haskell language server issue tracker](https://github.com/haskell/haskell-language-server/issues). Finding the issue could be useful to help resolve it and sometimes includes a workaround for the issue.\n- You can also check the [troubleshooting section](https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html) in the server documentation.\n\n#### Restarting the language server\n\n- Sometimes the language server might get stuck in a rut and stop responding to your latest changes.\n  Should this occur you can try restarting the language server with \u003ckbd\u003eCtrl\u003c/kbd\u003e \u003ckbd\u003eshift\u003c/kbd\u003e \u003ckbd\u003eP\u003c/kbd\u003e/\u003ckbd\u003e⌘\u003c/kbd\u003e \u003ckbd\u003eshift\u003c/kbd\u003e \u003ckbd\u003eP\u003c/kbd\u003e \u003e Restart Haskell LSP Server.\n\n#### `Failed to get project GHC version` on darwin M1 with stack\n\nIf you have installed stack via the official cannels, the binary will not be M1 native, but x86 and trigger the rosetta compatibility layer. GHCup provides real stack/HLS M1 binaries, so make sure you install stack via GHCup. Also see https://github.com/haskell/haskell-language-server/issues/2864\n\n#### `GHC ABIs don't match`\n\nIf you are using certain versions of GHC (such as 9.0.2 or 9.2.4) while running Stack, you may encounter this issue due to an outdated GHC bindist installed by Stack. The vscode-haskell extension does not support the use of GHC binaries managed by Stack. Therefore, it is recommended to configure Stack to allow GHCup to install these binaries instead. Please [refer to the instructions provided by ghcup for this purpose](https://www.haskell.org/ghcup/guide/#stack-integration).\n\nIf you really want to use GHC 9.0.2 managed by Stack, force it to install the fixed bindist (that includes profiling libs) by adding this to your stack.yaml (depending on your platform):\n\n```yml\nsetup-info:\n  ghc:\n    linux64-tinfo6:\n      9.0.2:\n        url: 'https://downloads.haskell.org/ghc/9.0.2/ghc-9.0.2a-x86_64-fedora27-linux.tar.xz'\n```\n\nNow make sure to remove cached/installed libraries to avoid getting segfaults at runtime.\n\nAs a final workaround, you can try to compile HLS from source (the extension should pick it up) via ghcup, see [https://haskell-language-server.readthedocs.io/en/stable/installation.html#ghcup](https://haskell-language-server.readthedocs.io/en/stable/installation.html#ghcup). In any case, the recommended approach is to let GHCup install the GHC binaries.\n\n#### `hGetContents: invalid argument (invalid byte sequence)`\n\nThis problem was encountered on darwin M2 with ghcup.\nShould you see the error that the \"Haskell server crashed 5 times in the last 3 minutes,\" you can check the Haskell output to see whether this was due to an error mentioning `hGetContents: invalid argument (invalid byte sequence)`.\nIf this is the case, setting `terminal.integrated.detectLocale` to `off` might resolve your issue.\n\n#### Using an old configuration\n\nIf something just doesn't work, but you recall an old configuration that did, you\nmay try forcing a particular setting, e.g. by disabling all automatic installations\nexcept HLS:\n\n```json\n    \"haskell.toolchain\": {\n        \"hls\": \"1.6.1.0\",\n        \"ghc\": null,\n        \"cabal\": null,\n        \"stack\": null\n    }\n```\n\n#### Stack/Cabal/GHC can not be found\n\nAlso make sure GHCup is installed and in `$PATH`. If you're not starting VSCode from the terminal, you might need to add `${HOME}/.ghcup/bin` to PATH like so:\n\n```json\n  \"haskell.serverEnvironment\": {\n    \"PATH\": \"${HOME}/.ghcup/bin:$PATH\"\n  }\n```\n\n## Contributing\n\nIf you want to help, get started by reading [Contributing](./docs/Contributing.md) for more details.\n\n## Release Notes\n\nSee the [Changelog](./Changelog.md) for more details.\n","funding_links":[],"categories":["TypeScript","Tools"],"sub_categories":["Mesh networks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell%2Fvscode-haskell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaskell%2Fvscode-haskell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell%2Fvscode-haskell/lists"}