{"record":{"id":"64ef70623fac184c","repo":"oraios/serena","slug":"haskell-language-server-wrapper-is-not-installed-o","errorCode":null,"errorMessage":"haskell-language-server-wrapper is not installed or not in PATH.\nSearched locations:\n  - {p}\nPlease install HLS via:\n  - GHCup: https://www.haskell.org/ghcup/\n  - Stack: stack install haskell-language-server\n  - Cabal: cabal install haskell-language-server\n  - Homebrew (macOS): brew install haskell-language-server","messagePattern":"haskell-language-server-wrapper is not installed or not in PATH\\.\nSearched locations:\n  - (.+?)\nPlease install HLS via:\n  - GHCup: https://www\\.haskell\\.org/ghcup/\n  - Stack: stack install haskell-language-server\n  - Cabal: cabal install haskell-language-server\n  - Homebrew \\(macOS\\): brew install haskell-language-server","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/haskell_language_server.py","lineNumber":62,"sourceCode":"                for arch_dir in os.listdir(stack_programs):\n                    arch_path = os.path.join(stack_programs, arch_dir)\n                    if os.path.isdir(arch_path):\n                        try:\n                            for ghc_dir in os.listdir(arch_path):\n                                hls_path = os.path.join(arch_path, ghc_dir, \"bin\", \"haskell-language-server-wrapper\")\n                                if os.path.isfile(hls_path) and os.access(hls_path, os.X_OK):\n                                    common_paths.append(hls_path)\n                        except (PermissionError, OSError):\n                            # Skip directories we can't read\n                            continue\n            except (PermissionError, OSError):\n                # Stack programs directory not accessible\n                pass\n\n        for path in common_paths:\n            if path and os.path.isfile(path) and os.access(path, os.X_OK):\n                return path\n\n        raise RuntimeError(\n            \"haskell-language-server-wrapper is not installed or not in PATH.\\n\"\n            \"Searched locations:\\n\" + \"\\n\".join(f\"  - {p}\" for p in common_paths if p) + \"\\n\"\n            \"Please install HLS via:\\n\"\n            \"  - GHCup: https://www.haskell.org/ghcup/\\n\"\n            \"  - Stack: stack install haskell-language-server\\n\"\n            \"  - Cabal: cabal install haskell-language-server\\n\"\n            \"  - Homebrew (macOS): brew install haskell-language-server\"\n        )\n\n    def __init__(self, config: LanguageServerConfig, repository_root_path: str, solidlsp_settings: SolidLSPSettings):\n        \"\"\"\n        Creates a HaskellLanguageServer instance. This class is not meant to be instantiated directly. Use LanguageServer.create() instead.\n        \"\"\"\n        hls_executable_path = self._ensure_hls_installed()\n        log.info(f\"Using haskell-language-server at: {hls_executable_path}\")\n\n        # Check if there's a haskell subdirectory with Stack/Cabal project","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/haskell_language_server.py#L44-L80","documentation":"RuntimeError raised by HaskellLanguageServer._ensure_hls_installed when the haskell-language-server-wrapper executable cannot be found. The server searches PATH plus well-known locations (GHCup, Stack programs directories) and lists every location it checked. HLS is not auto-installed by the library.","triggerScenarios":"Constructing the Haskell language server when none of the candidate paths exist or are executable (os.path.isfile + os.access X_OK both required).","commonSituations":"HLS never installed; installed via GHCup but for a different GHC version or user; PATH missing ~/.ghcup/bin in daemon/CI context; Stack-installed HLS not in ~/.local/bin; non-executable file at a searched path.","solutions":["Install HLS via GHCup: `ghcup install hls` and `ghcup set hls latest`","Ensure ~/.ghcup/bin is on PATH: export PATH=\"$HOME/.ghcup/bin:$PATH\"","Alternatively install with cabal (`cabal install haskell-language-server`) or stack (`stack install haskell-language-server`), and verify `haskell-language-server-wrapper --version`","If installed elsewhere, point the server at the binary via ls_path configuration"],"exampleFix":"// before\nhaskell-language-server-wrapper --version  # not found\n// after\nghcup install hls\nexport PATH=\"$HOME/.ghcup/bin:$PATH\"\nhaskell-language-server-wrapper --version","handlingStrategy":"validation","validationCode":"import os, shutil\ndef ensure_hls_installed():\n    candidates = [shutil.which('haskell-language-server-wrapper'),\n                  os.path.expanduser('~/.ghcup/bin/haskell-language-server-wrapper'),\n                  os.path.expanduser('~/.local/bin/haskell-language-server-wrapper')]\n    if not any(p and os.path.isfile(p) and os.access(p, os.X_OK) for p in candidates):\n        raise FileNotFoundError('Install HLS: ghcup install hls')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install HLS with ghcup and add ~/.ghcup/bin to PATH in profiles and CI","Run `haskell-language-server-wrapper --version` as a setup smoke test","Ensure the executable bit is set on the binary","Match HLS version to your active GHC version"],"tags":["haskell","hls","path","missing-binary","language-server"],"backgroundTag":"missing-executable-on-path","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}