Skip to content
This repository was archived by the owner on Jan 31, 2024. It is now read-only.

rvl/hls-test

Repository files navigation

This is a library+exe project generated with cabal init.

Test procedure

  1. Ensure that you have haskell-language-server, hie-bios and ghc configured. I have tried:

    • ghc-8.6.5
    • ghc-8.8.4
    • haskell-language-server-0.5.0
    • ghcide-0.4.0 rev 10dbde0

    There is a shell.nix which contains these. Use lorri and emacs-direnv to integrate with emacs.

  2. Verify that cabal build all works. Once that is tested, remove dist-newstyle and .ghc.environment*.

  3. Set up a hie.yaml symlink:

    ln -s direct-hie.yaml hie.yaml
    
  4. Open app/Main.hs in emacs with lsp-haskell. There is a .dir-locals.el file to configure the hie command.

    It will say "Could not find module MyLib" on the import line.

  5. Open src/MyLib.hs.

    Once this file is loaded, the error in the other module will disappear.

hie-bios output

See that -isrc is present for app/Main.hs.

rodney@blue:~/dev/test/hls-test % hie-bios debug app/Main.hs
Root directory:        /home/rodney/dev/test/hls-test
Component directory:   /home/rodney/dev/test/hls-test
GHC options:           -XOverloadedStrings -XTypeApplications -XDataKinds -fwarn-unused-binds -fwarn-unused-imports -fwarn-orphans -Wno-missing-home-modules -isrc -iapp
GHC library directory: CradleSuccess "/nix/store/vk02b66pfa4qhn7dfwwkl6s4plcywslx-ghc-8.6.5/lib/ghc-8.6.5"
GHC version:           CradleSuccess "8.6.5"
Config Location:       /home/rodney/dev/test/hls-test/hie.yaml
Cradle:                Cradle {cradleRootDir = "/home/rodney/dev/test/hls-test", cradleOptsProg = CradleAction: Direct}
Dependencies:

Analysis

  • The cabal-hie.yaml configuration works correctly -- no issue with Cabal cradles.
  • hie-bios debug app/Main.hs reports correct ghc -i options.
  • Test latest ghcide -- same result
  • Test ghc8102 -- ghcide won't build
  • Test ghc884

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published