-
Notifications
You must be signed in to change notification settings - Fork 107
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
Document use with editor (f.e. emacs) #184
Comments
Hey! Personally, I use |
@ryantrinkle Integrating obelisk with haskell-ide-engine would be excellent. |
You can use nix-buffer for this but it requires some extra configuration. |
I just got something like this working, with Visual Studio Code but Emacs should work too since it's through hie. It's a bit unfortunate that it's not very feasible to use stack-based tools (stack+intero always "just worked" for me), but haskell-ide-engine (hie) is pretty good now and it looks like it's in position to be the dominating IDE integration point. What I did to get this working, maybe it will help you or somebody else:
At this point code you write in common at least will have nice IDE features (my minimum for this is red underlining of compile errors). For various reasons though, when it tries to run
aand at this point I can see compile errors in |
FYI this still won't have a local hoogle or local documentation in general (which you might want when talking about using an IDE)...if anybody has suggestions for that, that would be great! |
I had success with Emacs + Dante, so I thought I would share. -- Local Variables:
-- dante-project-root: "/obelisk/project/root/path/"
-- dante-repl-command-line: ("nix-shell" "--pure" "-A" "shells.ghc" "--run" "cabal new-repl --builddir=dist/dante --project-file=cabal.project frontend")
-- eval: (dante-mode)
-- eval: (flycheck-mode)
-- End:
|
With this jyp/dante#93 it works fine for me. |
Nice! I tried using |
Some notes on using For older versions of the plugin, the ghcid integration is pretty simple, as all you have to do is run the Newer versions deprecated this command in favor of a single configurable path to a shell executable that it calls with some randomly generated file path to use for the output. You can create a bash script that wraps a call to Here's a script:
Another solution is to just revert to an older version of the extension (<= 0.7). See microsoft/vscode#12764 (comment). EDIT: Switched ghcid command in bash script from |
|
@3noch I don't think we pass through arguments to |
I was hoping the integration didn't need to pass special arguments. But aside from that yes it would be nice if |
Just thought I'd mention that the following in a ((nil . (
(dante-project-root . "~/app")
(dante-repl-command-line . ("ob" "repl"))
))) I haven't tested this extensively, but it appears to work because The string It also seems there could be some cross pollination between this issue and the following: |
Eh never mind, because
Looks like I'll need something like this in the ((nil . (
(dante-project-root . "~/app")
(dante-repl-command-line . ("nix-shell" "--pure" "-A" "shells.ghc" "--run"
"cabal new-repl frontend --builddir=dist/dante"))
))) |
looking at @JBetz comment, so how I can integrate my ob project to the VSCode? Using the script and start ghcid from VSCode command? |
Is support for haskell-ide-engine possible at the moment? I saw on Reddit a while ago that support for it may be coming soon? |
I believe @mpickering did some preparations work for this. Also hie gets installed into the nix shell by default these days in an Obelisk project. So, I believe there is just a little push needed to get it over the finish line. I haven't found the time yet to check it out, maybe it even already works :-P |
Indeed: #363 (comment) |
Yeah hie is now bundled with Obelisk, which is great 👍
like @cah6 suggested to get it working. Is there any way to avoid this? Having these cabal files around is kind of annoying and makes the setup harder. |
Just wanted to share |
I haven't tried this project yet (still in the process of getting through how-to-use and how-to-install-correctly) and so I'm wondering, how is the IDE experience in VS Code with the haskel LSP using the addition you try to add to reflex @ibizaman ? |
@reallymemorable with Emacs and for what I use - on-the-fly syntax checking and code formatting upon saving - it’s flawless. |
Are you launching vscode from inside `ob shell`'s shell?
Sent with [ProtonMail](https://protonmail.com/) Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Thursday, February 11th, 2021 at 2:48 AM, Raptazure ***@***.***> wrote:
Hi, I am trying to open a new project with VS Code inside ob shell, but there are a bunch of errors with haskell.haskell extension on. Is there a way to fix this? Thanks.
[image](https://user-images.githubusercontent.com/44319278/107612083-6ae5f080-6c80-11eb-8794-79df05e26296.png)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, [view it on GitHub](#184 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAAA7HX4QOXRVTGVLLFUUD3S6ODTTANCNFSM4FMNYD7Q).
|
|
I also have this cradle:
cabal:
- path: "./frontend/src/"
component: "lib:frontend"
- path: "./common/src/"
component: "lib:common"
- path: "./backend/src/"
component: "lib:backend" |
I have my IDE set up with nixos, spacemacs, direnv, and easy-hls-nix, but it's not perfect and there are some problems right now. Notably, nixos-21.05 (and nixpkgs-unstable) dropped support for ghc-8.6.5. From the hls readme https://github.com/haskell/haskell-language-server#installation-from-source:
Direnv should let you hls builld the project fine without having to start it with ob shell / nix-shell (my envrc):
Unfortunately, due to a different problem (haskell/haskell-language-server#1601), hls binaries downloaded from their github releases page don't seem to work well with nix, so I tried building it locally, though of course, building locally only works for more recent versions of GHC and does not work with GHC 8.6.5, which is the only version supported by obelisk. I wish there was some way that I could just use whatever version of GHC I want with Obelisk, but it doesn't look like the core Obelisk libraries are available in Hackage... I would still appreciate documentation for using obelisk with an editor being added. |
This is how I trie to work with haskell-language-server, using easy-hls-nix:
If I use any of the later available commits of easy-hls-nix, I get a problem running cabal: relocation error: /usr/lib/libc.so.6: symbol _dl_fatal_printf version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference Those early version that do work in principle come with there own problems, however. This earliest version I use above says: Installation error: unable to load package `ghc-prim-0.5.3' |
Hi!
Is there any information around how to use an obelisk based project smoothly with emacs (haskell-mode, propably other related packages)? (at least saw that @ryantrinkle was using emacs in his YOW talk :))
So f.e. how to get interactive hasekll mode (REPL) working (for ghc / ghcjs) - guess
ob repl
has to be used?Or do you just run
ob run
in an emacs term/shell? Is there a working way to get the error parser working that buffer, so I can jump to source file whenob run
hits an compiler error?The text was updated successfully, but these errors were encountered: