Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running HLS features on a standalone Haskell script #613

Closed
KristianBalaj opened this issue May 22, 2022 · 2 comments
Closed

Running HLS features on a standalone Haskell script #613

KristianBalaj opened this issue May 22, 2022 · 2 comments

Comments

@KristianBalaj
Copy link

Having a following script:

#!/usr/bin/env cabal
{- cabal:
build-depends: base
            , split
-}

import Data.List.Split (splitOn)

main :: IO ()
main = do
  let orders = splitOn "x" "axbxc"
  putStrLn $ head orders

I want to be able to have HLS features on this script.
Is it possible in any way?

@fendor
Copy link
Collaborator

fendor commented May 22, 2022

Hi! Unfortunately, this is not possible at the moment. You might be able to get a similar result by using cabal install --lib base split --package-env=. and creating a hie.yaml file with the contents:

cradle:
  direct:
    arguments:
      - -package-env
      - .ghc.environment.x86_64-linux-<version> # check what file has been generated after `cabal install --lib --package-env=.`
      - Script.hs

Native support ticket: haskell/hie-bios#217
Some context for environment files: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/packages.html#package-environments

@fendor
Copy link
Collaborator

fendor commented May 11, 2023

closing, since no activity, and also, not the job of vscode-haskell. See here the discussion for a workaround: haskell/haskell-language-server#3572

@fendor fendor closed this as completed May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants