diff --git a/hie-other.yaml b/hie-stack.yaml similarity index 76% rename from hie-other.yaml rename to hie-stack.yaml index 1dad7acf2..4fa864237 100644 --- a/hie-other.yaml +++ b/hie-stack.yaml @@ -1,14 +1,12 @@ -# This can be symlinked as hie.yaml to make hls use a different ghc version -# from the default stack.yaml. -# -# Eg mac m1 users could use it to select ghc 8.10, -# until there is a ghc-9-compatible arm hls binary. -# (Though, since such a binary is relatively easy to build yourself, -# and 2-3x faster, I recommend doing that instead.) +# Symlink this as hie.yaml to make HLS use the stack yaml/ghc mentioned below. +# This works better than relying on the implicit cradle, which doesn't +# work with multi-package projects (opening a file from a second package breaks HLS). + +# Circa HLS 1.9.1.0, this one (using GHC 9.4) does not work. cradle: stack: - stackYaml: "stack8.10.yaml" + stackYaml: "stack.yaml" # since there is a hie.yaml, these must be listed explicitly # (a current limitation of hls with a multi-package stack project): diff --git a/hie-stack9.2.yaml b/hie-stack9.2.yaml new file mode 100644 index 000000000..4cc3e2267 --- /dev/null +++ b/hie-stack9.2.yaml @@ -0,0 +1,47 @@ +# Symlink this as hie.yaml to make HLS use the stack yaml/ghc mentioned below. +# This works better than relying on the implicit cradle, which doesn't +# work with multi-package projects (opening a file from a second package breaks HLS). + +# Circa HLS 1.9.1.0, this one (using GHC 9.2) is the only one that works. + +cradle: + stack: + stackYaml: "stack9.2.yaml" + + # since there is a hie.yaml, these must be listed explicitly + # (a current limitation of hls with a multi-package stack project): + components: + - path: "hledger-lib/" + component: "hledger-lib:lib" + - path: "hledger-lib/test/doctests.hs" + component: "hledger-lib:test:doctest" + - path: "hledger-lib/test/unittest.hs" + component: "hledger-lib:test:unittest" + + - path: "hledger/" + component: "hledger:lib" + - path: "hledger/app/" + component: "hledger:exe:hledger" + - path: "hledger/test/unittest.hs" + component: "hledger:test:unittest" + - path: "hledger/bench/" + component: "hledger:bench:bench" + + - path: "hledger-ui/" + component: "hledger-ui:exe:hledger-ui" + + - path: "hledger-web/" + component: "hledger-web:lib" + - path: "hledger-web/app/" + component: "hledger-web:exe:hledger-web" + - path: "hledger-web/test/" + component: "hledger-web:test:test" + + - path: "bin/" + component: "hledger:lib" + - path: "tools/" + component: "hledger:lib" + + # silences hls error for Shake.hs, but I think also ignores actual errors + - path: "Shake.hs" + component: "hledger:lib" diff --git a/hie.yaml b/hie.yaml new file mode 120000 index 000000000..b8f98633d --- /dev/null +++ b/hie.yaml @@ -0,0 +1 @@ +hie-stack9.2.yaml \ No newline at end of file