Open benrbray opened 1 year ago
Here, I got obelisk to work with haskell-language-server and emacs.
I run nix-shell -A shells.ghc
and start emacs from within the shell. I assume the same is possible with vscode.
FWIW, we have a template project for obelisk and rhyolite projects running under GHC8107 with HLS here: https://github.com/BeFunctional/obelisk-rhyolite-template
IIRC Macs are still out of luck with those branches, but, if you're only linux, ob shell
and code .
should get you hls. If you're using the remote development, you can use a .envrc
with direnv to load the PATH set by ob shell before HLS starts.
@o1lo01ol1o I tried to use it but it installs HLS 1.1.0.0. Any idea how to fix it?
When I try to use nix-shell
I get error:
Arguments: ["--lsp","-d","-l","/var/tmp/hls.log"]
Cradle directory: ...
Cradle type: Cabal
Tool versions found on the $PATH
cabal: 3.4.1.0
stack: 2.9.1
ghc: 8.10.7
Consulting the cradle to get project GHC version...
2023-06-29T08:01:03.951242Z | Debug | executing command: cabal exec -v0 -- ghc --print-libdir
Failed to find the GHC version of this Cabal project.
Error when calling cabal exec -v0 -- ghc --print-libdir
cabal: Could not resolve dependencies:
[__0] trying: backend-0.1 (user goal)
[__1] unknown package: obelisk-route (dependency of backend)
[__1] fail (backjumping, conflict set: backend, obelisk-route)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: backend, obelisk-route
2023-06-29T08:01:05.891538Z | Info | Starting server
2023-06-29T08
Process lsp-haskell stderr finished
I want to try out reflex/obelisk but I have no experience with Nix so I'm finding it quite difficult to get started.
I installed
obelisk
with:I'm starting from the basic starter project,
I can successfully build and run the project with
ob run
, andob shell
drops me into a nix shell. Here's some version info:Attempt 1:
code
insideob shell
First, I tried:
However, none of the project dependencies are recognized by HLS. For example, visiting
frontend/src/Frontend.hs
,Attempt 2: Modify
default.nix
, Manually Compilehaskell-language-server
I tried a few of the answers at obsidiansystems/obelisk#986, but since I am new to Nix there is not quite enough information there for me to reproduce them myself. My attempts to modify
default.nix
caused some strange errors. I was able to compile a recent version ofhaskell-language-server
using thecabal
found in the nix shell, but the executable was installed to~/.cabal/bin
rather than somewhere within Nix like I would expect. Openingcode
gives the same errors.Questions
obelisk
project with basichaskell-language-server
support within VS Code?obelisk
/reflex
without Nix? it seems more trouble than it is worth for my purposesThanks!